Chat commands fix

This commit is contained in:
alwx 2017-04-26 12:06:36 +03:00 committed by Roman Volosovskyi
parent 0d55009388
commit 4e932d9ae8
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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]