[#12418] Error when declining membership request

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
andrey 2021-08-06 12:39:08 +02:00
parent 8298c35db2
commit 1f38423723
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272

View File

@ -176,22 +176,23 @@
"before processing we want to filter and sort messages, so we can process first only messages which will be showed" "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]} {:events [:sanitize-messages-and-process-response]}
[{:keys [db] :as cofx} ^js response-js process-async] [{:keys [db] :as cofx} ^js response-js process-async]
(let [current-chat-id (:current-chat-id db) (when response-js
{:keys [db messages transactions chats statuses]} (let [current-chat-id (:current-chat-id db)
(reduce group-by-and-update-unviewed-counts {:keys [db messages transactions chats statuses]}
{:db db :chats #{} :transactions #{} :statuses [] :messages [] (reduce group-by-and-update-unviewed-counts
:current-chat-id current-chat-id} {:db db :chats #{} :transactions #{} :statuses [] :messages []
(.-messages response-js))] :current-chat-id current-chat-id}
(sort-js-messages! response-js messages) (.-messages response-js))]
(fx/merge cofx (sort-js-messages! response-js messages)
{:db db (fx/merge cofx
:utils/dispatch-later (concat [] {:db db
(when (seq statuses) :utils/dispatch-later (concat []
[{:ms 100 :dispatch [:process-statuses statuses]}]) (when (seq statuses)
(when (seq transactions) [{:ms 100 :dispatch [:process-statuses statuses]}])
(for [transaction-hash transactions] (when (seq transactions)
{:ms 100 :dispatch [:watch-tx transaction-hash]})))} (for [transaction-hash transactions]
(process-response response-js process-async)))) {:ms 100 :dispatch [:watch-tx transaction-hash]})))}
(process-response response-js process-async)))))
(fx/defn remove-hash (fx/defn remove-hash
[{:keys [db]} envelope-hash] [{:keys [db]} envelope-hash]