[Fixes: #12191] Fix muting chat
This commit is contained in:
parent
d72feed968
commit
d1a3a27226
|
@ -321,12 +321,6 @@
|
||||||
(log/error "mute chat failed" chat-id error)
|
(log/error "mute chat failed" chat-id error)
|
||||||
{:db (assoc-in db [:chats chat-id :muted] (not muted?))})
|
{:db (assoc-in db [:chats chat-id :muted] (not muted?))})
|
||||||
|
|
||||||
(fx/defn mute-chat-successful
|
|
||||||
{:events [::mute-chat-successful]}
|
|
||||||
[{:keys [db]} chat-id response]
|
|
||||||
(let [chat (chats-store/<-rpc (first (:chats response)))]
|
|
||||||
{:db (assoc-in db [:chats chat-id] chat)}))
|
|
||||||
|
|
||||||
(fx/defn mute-chat
|
(fx/defn mute-chat
|
||||||
{:events [::mute-chat-toggled]}
|
{:events [::mute-chat-toggled]}
|
||||||
[{:keys [db] :as cofx} chat-id muted?]
|
[{:keys [db] :as cofx} chat-id muted?]
|
||||||
|
@ -335,7 +329,7 @@
|
||||||
::json-rpc/call [{:method (json-rpc/call-ext-method method)
|
::json-rpc/call [{:method (json-rpc/call-ext-method method)
|
||||||
:params [chat-id]
|
:params [chat-id]
|
||||||
:on-error #(re-frame/dispatch [::mute-chat-failed chat-id muted? %])
|
:on-error #(re-frame/dispatch [::mute-chat-failed chat-id muted? %])
|
||||||
:on-success #(re-frame/dispatch [::mute-chat-successful chat-id %])}]}))
|
:on-success #(log/debug "muted chat successfully")}]}))
|
||||||
|
|
||||||
(fx/defn show-profile
|
(fx/defn show-profile
|
||||||
{:events [:chat.ui/show-profile]}
|
{:events [:chat.ui/show-profile]}
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
(dissoc :members)))
|
(dissoc :members)))
|
||||||
|
|
||||||
(fx/defn fetch-chats-rpc [cofx {:keys [on-success]}]
|
(fx/defn fetch-chats-rpc [cofx {:keys [on-success]}]
|
||||||
{::json-rpc/call [{:method (json-rpc/call-ext-method "activeChats")
|
{::json-rpc/call [{:method (json-rpc/call-ext-method "chats")
|
||||||
:params []
|
:params []
|
||||||
:on-success #(on-success (map <-rpc %))
|
:on-success #(on-success (map <-rpc %))
|
||||||
:on-failure #(log/error "failed to fetch chats" 0 -1 %)}]})
|
:on-failure #(log/error "failed to fetch chats" 0 -1 %)}]})
|
||||||
|
|
|
@ -780,6 +780,13 @@
|
||||||
(fn [{:keys [synced-from]}]
|
(fn [{:keys [synced-from]}]
|
||||||
synced-from))
|
synced-from))
|
||||||
|
|
||||||
|
(re-frame/reg-sub
|
||||||
|
:chats/muted
|
||||||
|
(fn [[_ chat-id] _]
|
||||||
|
(re-frame/subscribe [:chat-by-id chat-id]))
|
||||||
|
(fn [{:keys [muted]}]
|
||||||
|
muted))
|
||||||
|
|
||||||
(re-frame/reg-sub
|
(re-frame/reg-sub
|
||||||
:chats/chat-type
|
:chats/chat-type
|
||||||
(fn [[_ chat-id] _]
|
(fn [[_ chat-id] _]
|
||||||
|
|
|
@ -160,7 +160,7 @@
|
||||||
current-chat-id @(re-frame/subscribe [:chats/current-profile-chat])
|
current-chat-id @(re-frame/subscribe [:chats/current-profile-chat])
|
||||||
messages @(re-frame/subscribe [:chats/profile-messages-stream current-chat-id])
|
messages @(re-frame/subscribe [:chats/profile-messages-stream current-chat-id])
|
||||||
no-messages? @(re-frame/subscribe [:chats/chat-no-messages? current-chat-id])
|
no-messages? @(re-frame/subscribe [:chats/chat-no-messages? current-chat-id])
|
||||||
muted? (:muted @(re-frame/subscribe [:chats/chat public-key]))
|
muted? @(re-frame/subscribe [:chats/muted public-key])
|
||||||
[first-name second-name] (multiaccounts/contact-two-names contact true)
|
[first-name second-name] (multiaccounts/contact-two-names contact true)
|
||||||
on-share #(re-frame/dispatch [:show-popover (merge
|
on-share #(re-frame/dispatch [:show-popover (merge
|
||||||
{:view :share-chat-key
|
{:view :share-chat-key
|
||||||
|
@ -205,4 +205,3 @@
|
||||||
:render-data {:chat-id current-chat-id}
|
:render-data {:chat-id current-chat-id}
|
||||||
:render-fn status.views/render-message
|
:render-fn status.views/render-message
|
||||||
:data messages}]])))
|
:data messages}]])))
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
||||||
"owner": "status-im",
|
"owner": "status-im",
|
||||||
"repo": "status-go",
|
"repo": "status-go",
|
||||||
"version": "v0.79.7",
|
"version": "v0.79.7+hotfix.1",
|
||||||
"commit-sha1": "60de443e89bd6a5d4f5b71e7038528d27f26090b",
|
"commit-sha1": "f27cc7ef218383984b3a1cc7cdb69e649cbeeca2",
|
||||||
"src-sha256": "0gjgkqyvpbwg8drwi2mpcan5vxqrnrzl1j0ccmm2m8vq7j3b1332"
|
"src-sha256": "1xcby30rqiqcr05nrjv720ak3prgdcp3644sld8cbnxr1j0szd67"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue