From 952d3736c8ef4218769d7cd0d2f500281f416892 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Thu, 30 Jun 2016 11:12:10 +0300 Subject: [PATCH] rendering of a new request in list --- src/status_im/chat/handlers/requests.cljs | 4 +--- src/status_im/chat/views/suggestions.cljs | 7 +++++-- src/status_im/commands/handlers/loading.cljs | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/status_im/chat/handlers/requests.cljs b/src/status_im/chat/handlers/requests.cljs index 828e952b81..534a84cf6c 100644 --- a/src/status_im/chat/handlers/requests.cljs +++ b/src/status_im/chat/handlers/requests.cljs @@ -29,9 +29,7 @@ :status "open"}) (realm/sorted :added :desc) (realm/collection->map)) - requests' (->> requests - (map #(update % :type keyword)) - (into '()))] + requests' (map #(update % :type keyword) requests)] (assoc-in db [:chats chat-id' :requests] requests'))) (register-handler :add-request diff --git a/src/status_im/chat/views/suggestions.cljs b/src/status_im/chat/views/suggestions.cljs index 1c91b8d89f..4438fe5865 100644 --- a/src/status_im/chat/views/suggestions.cljs +++ b/src/status_im/chat/views/suggestions.cljs @@ -37,8 +37,11 @@ [text {:style st/request-message-info} "By console, today at 14:50"]]]]) -(defn render-request-row [row _ _] - (list-item [request-item row])) +(defn render-request-row + [{:keys [chat-id message-id] :as row} _ _] + (list-item + ^{:key [chat-id message-id]} + [request-item row])) (defn suggestion-list-item [[command {:keys [description] diff --git a/src/status_im/commands/handlers/loading.cljs b/src/status_im/commands/handlers/loading.cljs index 2291ade0fc..b7b26589fe 100644 --- a/src/status_im/commands/handlers/loading.cljs +++ b/src/status_im/commands/handlers/loading.cljs @@ -91,13 +91,13 @@ (reg-handler ::fetch-commands! (u/side-effect! fetch-commands!)) (reg-handler ::validate-hash - (after dispatch-loaded!) - validate-hash) + (after dispatch-loaded!) + validate-hash) (reg-handler ::parse-commands! (u/side-effect! parse-commands!)) (reg-handler ::add-commands - (after save-commands-js!) - add-commands) + (after save-commands-js!) + add-commands) (reg-handler ::loading-failed! (u/side-effect! loading-failed!))