From 1f384237233c42def171654754476c5e859bebee Mon Sep 17 00:00:00 2001 From: andrey Date: Fri, 6 Aug 2021 12:39:08 +0200 Subject: [PATCH] [#12418] Error when declining membership request Signed-off-by: andrey --- src/status_im/transport/message/core.cljs | 33 ++++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/status_im/transport/message/core.cljs b/src/status_im/transport/message/core.cljs index 80b6c08fb5..1cbed3e725 100644 --- a/src/status_im/transport/message/core.cljs +++ b/src/status_im/transport/message/core.cljs @@ -176,22 +176,23 @@ "before processing we want to filter and sort messages, so we can process first only messages which will be showed" {:events [:sanitize-messages-and-process-response]} [{:keys [db] :as cofx} ^js response-js process-async] - (let [current-chat-id (:current-chat-id db) - {:keys [db messages transactions chats statuses]} - (reduce group-by-and-update-unviewed-counts - {:db db :chats #{} :transactions #{} :statuses [] :messages [] - :current-chat-id current-chat-id} - (.-messages response-js))] - (sort-js-messages! response-js messages) - (fx/merge cofx - {:db db - :utils/dispatch-later (concat [] - (when (seq statuses) - [{:ms 100 :dispatch [:process-statuses statuses]}]) - (when (seq transactions) - (for [transaction-hash transactions] - {:ms 100 :dispatch [:watch-tx transaction-hash]})))} - (process-response response-js process-async)))) + (when response-js + (let [current-chat-id (:current-chat-id db) + {:keys [db messages transactions chats statuses]} + (reduce group-by-and-update-unviewed-counts + {:db db :chats #{} :transactions #{} :statuses [] :messages [] + :current-chat-id current-chat-id} + (.-messages response-js))] + (sort-js-messages! response-js messages) + (fx/merge cofx + {:db db + :utils/dispatch-later (concat [] + (when (seq statuses) + [{:ms 100 :dispatch [:process-statuses statuses]}]) + (when (seq transactions) + (for [transaction-hash transactions] + {:ms 100 :dispatch [:watch-tx transaction-hash]})))} + (process-response response-js process-async))))) (fx/defn remove-hash [{:keys [db]} envelope-hash]