Skip to content

Commit

Permalink
fix: update close-and-remove-chat
Browse files Browse the repository at this point in the history
  • Loading branch information
BalogunofAfrica committed Nov 15, 2023
1 parent 3f1c32e commit 75ef607
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/status_im2/contexts/chat/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,11 @@
(update :chats-home-list disj chat-id)
(assoc :current-chat-id nil))
:json-rpc/call [{:method "wakuext_deactivateChat"
:params [{:id chat-id}]
:params [{:id chat-id :preserveHistory true}]
:on-success #()
:on-error #(log/error "failed to create public chat" chat-id %)}]}
(clear-history chat-id true)))

(rf/defn remove-chat
"Removes chat with provided id from the chat list"
[{:keys [db]} chat-id]
{:db (-> db
(update :chats-home-list disj chat-id)
(assoc :current-chat-id nil))})

(rf/defn offload-messages
{:events [:chat/offload-messages]}
[{:keys [db]} chat-id]
Expand Down Expand Up @@ -296,8 +289,9 @@
(rf/merge cofx
{:effects/push-notifications-clear-message-notifications [chat-id]
:dispatch [:shell/close-switcher-card
chat-id]}
(remove-chat chat-id)))
chat-id]}
(deactivate-chat chat-id)
(offload-messages chat-id)))

(rf/defn unmute-chat-community
{:events [:chat/unmute-chat-community]}
Expand Down

0 comments on commit 75ef607

Please sign in to comment.