Clear :last-message when clearing chat history. Fixes #212

This commit is contained in:
Julien Eluard 2017-06-23 00:45:28 +02:00 committed by Roman Volosovskyi
parent 016fe90abe
commit fc7cc1d795
1 changed files with 3 additions and 1 deletions

View File

@ -56,7 +56,9 @@
(defn clear-messages
[{:keys [current-chat-id] :as db} _]
(assoc-in db [:chats current-chat-id :messages] '()))
(-> db
(assoc-in [:chats current-chat-id :messages] '())
(assoc-in [:chats current-chat-id :last-message] nil)))
(register-handler :clear-history
(after delete-messages!)