From fc7cc1d795a9fa93d2628435e8b864e75d35e660 Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Fri, 23 Jun 2017 00:45:28 +0200 Subject: [PATCH] Clear :last-message when clearing chat history. Fixes #212 --- src/status_im/group_settings/handlers.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/status_im/group_settings/handlers.cljs b/src/status_im/group_settings/handlers.cljs index 711a7ddde1..58e8f68cdd 100644 --- a/src/status_im/group_settings/handlers.cljs +++ b/src/status_im/group_settings/handlers.cljs @@ -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!)