mirror of
https://github.com/status-im/status-react.git
synced 2025-02-17 13:28:04 +00:00
[16543] Fix muting channel from inside and outside chat page (#16544)
This commit is contained in:
parent
919fbf2091
commit
f5948fa016
@ -106,8 +106,8 @@
|
|||||||
:label (i18n/label :t/share-channel)})
|
:label (i18n/label :t/share-channel)})
|
||||||
|
|
||||||
(defn actions
|
(defn actions
|
||||||
[{:keys [locked? id community-id]} inside-chat?]
|
[{:keys [locked? chat-id]} inside-chat?]
|
||||||
(let [{:keys [muted muted-till chat-type]} (rf/sub [:chat-by-id (str community-id id)])]
|
(let [{:keys [muted muted-till chat-type]} (rf/sub [:chat-by-id chat-id])]
|
||||||
(cond
|
(cond
|
||||||
locked?
|
locked?
|
||||||
[quo/action-drawer
|
[quo/action-drawer
|
||||||
@ -120,7 +120,7 @@
|
|||||||
[quo/action-drawer
|
[quo/action-drawer
|
||||||
[[(action-view-members-and-details)
|
[[(action-view-members-and-details)
|
||||||
(action-mark-as-read)
|
(action-mark-as-read)
|
||||||
(action-toggle-muted (str community-id id) muted muted-till chat-type)
|
(action-toggle-muted chat-id muted muted-till chat-type)
|
||||||
(action-notification-settings)
|
(action-notification-settings)
|
||||||
(action-pinned-messages)
|
(action-pinned-messages)
|
||||||
(action-invite-people)
|
(action-invite-people)
|
||||||
@ -132,7 +132,7 @@
|
|||||||
[[(action-view-members-and-details)
|
[[(action-view-members-and-details)
|
||||||
(action-token-requirements)
|
(action-token-requirements)
|
||||||
(action-mark-as-read)
|
(action-mark-as-read)
|
||||||
(action-toggle-muted (str community-id id) muted muted-till chat-type)
|
(action-toggle-muted chat-id muted muted-till chat-type)
|
||||||
(action-notification-settings)
|
(action-notification-settings)
|
||||||
(action-fetch-messages)
|
(action-fetch-messages)
|
||||||
(action-invite-people)
|
(action-invite-people)
|
||||||
|
@ -49,19 +49,21 @@
|
|||||||
(oops/oget event "nativeEvent.layout.y"))
|
(oops/oget event "nativeEvent.layout.y"))
|
||||||
|
|
||||||
(defn- channel-chat-item
|
(defn- channel-chat-item
|
||||||
[community-id community-color {chat-id :id muted? :muted? :as chat}]
|
[community-id community-color {:keys [:muted? id] :as chat}]
|
||||||
(let [sheet-content [actions/chat-actions
|
(let [sheet-content [actions/chat-actions
|
||||||
(assoc chat :chat-type constants/community-chat-type)
|
(assoc chat
|
||||||
|
:chat-type constants/community-chat-type
|
||||||
|
:chat-id (str community-id id))
|
||||||
false]
|
false]
|
||||||
channel-sheet-data {:selected-item (fn [] [quo/channel-list-item chat])
|
channel-sheet-data {:selected-item (fn [] [quo/channel-list-item chat])
|
||||||
:content (fn [] sheet-content)}]
|
:content (fn [] sheet-content)}]
|
||||||
[rn/view {:key chat-id :style {:margin-top 4}}
|
[rn/view {:key id :style {:margin-top 4}}
|
||||||
[quo/channel-list-item
|
[quo/channel-list-item
|
||||||
(assoc chat
|
(assoc chat
|
||||||
:default-color community-color
|
:default-color community-color
|
||||||
:on-long-press #(rf/dispatch [:show-bottom-sheet channel-sheet-data])
|
:on-long-press #(rf/dispatch [:show-bottom-sheet channel-sheet-data])
|
||||||
:muted? (or muted?
|
:muted? (or muted?
|
||||||
(rf/sub [:chat/check-channel-muted? community-id chat-id])))]]))
|
(rf/sub [:chat/check-channel-muted? community-id id])))]]))
|
||||||
|
|
||||||
(defn channel-list-component
|
(defn channel-list-component
|
||||||
[{:keys [on-category-layout community-id community-color on-first-channel-height-changed]}
|
[{:keys [on-category-layout community-id community-color on-first-channel-height-changed]}
|
||||||
@ -224,7 +226,7 @@
|
|||||||
:on-long-press #(rf/dispatch
|
:on-long-press #(rf/dispatch
|
||||||
[:show-bottom-sheet
|
[:show-bottom-sheet
|
||||||
{:content (fn []
|
{:content (fn []
|
||||||
[chat-actions/actions community-id id])}])
|
[chat-actions/actions chat false])}])
|
||||||
:community-id community-id})))
|
:community-id community-id})))
|
||||||
|
|
||||||
(defn add-handlers-to-chats
|
(defn add-handlers-to-chats
|
||||||
|
Loading…
x
Reference in New Issue
Block a user