From 4e932d9ae8946c4e9a316e59ddf7a24dbdee49d1 Mon Sep 17 00:00:00 2001 From: alwx Date: Wed, 26 Apr 2017 12:06:36 +0300 Subject: [PATCH] Chat commands fix --- src/status_im/chat/handlers.cljs | 6 ++++-- src/status_im/chat/screen.cljs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/status_im/chat/handlers.cljs b/src/status_im/chat/handlers.cljs index 4afb2b1b18..a0aed5a99f 100644 --- a/src/status_im/chat/handlers.cljs +++ b/src/status_im/chat/handlers.cljs @@ -206,8 +206,10 @@ chats (->> loaded-chats (map (fn [{:keys [chat-id] :as chat}] - (let [last-message (messages/get-last-message chat-id)] - [chat-id (assoc chat :last-message last-message)]))) + (let [last-message (messages/get-last-message chat-id) + prev-chat (get chats chat-id) + new-chat (assoc chat :last-message last-message)] + [chat-id (merge prev-chat new-chat)]))) (into (priority-map-by compare-chats))))] (-> db diff --git a/src/status_im/chat/screen.cljs b/src/status_im/chat/screen.cljs index 6e8a6a5e61..86d22114f3 100644 --- a/src/status_im/chat/screen.cljs +++ b/src/status_im/chat/screen.cljs @@ -177,7 +177,8 @@ show-emoji? [:chat-ui-props :show-emoji?] layout-height [:get :layout-height] input-text [:chat :input-text]] - {:component-did-mount #(dispatch [:check-autorun]) + {:component-did-mount #(do (dispatch [:check-autorun]) + (dispatch [:update-suggestions])) :component-will-unmount #(dispatch [:set-chat-ui-props {:show-emoji? false}])} [view {:style st/chat-view :on-layout (fn [event]