Skip to content

Commit

Permalink
unmute community when atleast one channel is unmuted
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-mut committed Jul 6, 2023
1 parent e494c57 commit b000da2
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 195 deletions.
10 changes: 9 additions & 1 deletion src/status_im2/contexts/chat/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@
(deactivate-chat chat-id)
(offload-messages chat-id)))

(rf/defn unmute-chat-community
{:events [:chat/unmute-chat-community]}
[{:keys [db]} chat-id muted?]
(let [{:keys [community-id]} (get-in db [:chats chat-id])]
{:db (assoc-in db [:communities community-id :muted] muted?)}))

(rf/defn mute-chat-failed
{:events [:chat/mute-failed]}
[{:keys [db]} chat-id muted? error]
Expand All @@ -301,6 +307,8 @@
{:events [:chat/mute-successfully]}
[{:keys [db]} chat-id muted-till mute-type muted? chat-type]
(log/debug "muted chat successfully" chat-id " for" muted-till)
(when-not muted?
(rf/dispatch [:chat/unmute-chat-community chat-id muted?]))
(let [time-string (fn [duration-kw unmute-time]
(i18n/label duration-kw {:duration unmute-time}))
not-community-chat? #(contains? #{constants/public-chat-type
Expand Down Expand Up @@ -359,7 +367,7 @@
:params params
:on-error #(rf/dispatch [:chat/mute-failed chat-id muted? %])
:on-success #(rf/dispatch [:chat/mute-successfully chat-id % mute-type
(not muted?) chat-type])}]}))
muted? chat-type])}]}))

(rf/defn show-clear-history-confirmation
{:events [:chat.ui/show-clear-history-confirmation]}
Expand Down
72 changes: 0 additions & 72 deletions src/status_im2/contexts/syncing/how_to_pair/style.cljs

This file was deleted.

4 changes: 2 additions & 2 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"owner": "status-im",
"repo": "status-go",
"version": "ft/mute-community",
"commit-sha1": "c06f7a6c381488ce52cf212193970a079750c6fd",
"src-sha256": "1gbbq16phjkqxbijcflcvb2vx5z1s6i3bbsycpi1dbhxi3cq8y14"
"commit-sha1": "6013a7bb965cf4815da0e039d5a47f9f7997da73",
"src-sha256": "02xb016prxc1g1m4irmjqngh436a1fiqj4n0v37hbkqa2gifaxgs"
}
14 changes: 0 additions & 14 deletions visual-test/config.json

This file was deleted.

19 changes: 0 additions & 19 deletions visual-test/environment.js

This file was deleted.

40 changes: 0 additions & 40 deletions visual-test/global-setup.js

This file was deleted.

7 changes: 0 additions & 7 deletions visual-test/global-teardown.js

This file was deleted.

40 changes: 0 additions & 40 deletions visual-test/setup.js

This file was deleted.

0 comments on commit b000da2

Please sign in to comment.