Skip to content

Commit d1a3a27

Browse files
author
Serhy
committed
[Fixes: status-im#12191] Fix muting chat
1 parent d72feed commit d1a3a27

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/status_im/chat/models.cljs

+1-7
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,6 @@
321321
(log/error "mute chat failed" chat-id error)
322322
{:db (assoc-in db [:chats chat-id :muted] (not muted?))})
323323

324-
(fx/defn mute-chat-successful
325-
{:events [::mute-chat-successful]}
326-
[{:keys [db]} chat-id response]
327-
(let [chat (chats-store/<-rpc (first (:chats response)))]
328-
{:db (assoc-in db [:chats chat-id] chat)}))
329-
330324
(fx/defn mute-chat
331325
{:events [::mute-chat-toggled]}
332326
[{:keys [db] :as cofx} chat-id muted?]
@@ -335,7 +329,7 @@
335329
::json-rpc/call [{:method (json-rpc/call-ext-method method)
336330
:params [chat-id]
337331
:on-error #(re-frame/dispatch [::mute-chat-failed chat-id muted? %])
338-
:on-success #(re-frame/dispatch [::mute-chat-successful chat-id %])}]}))
332+
:on-success #(log/debug "muted chat successfully")}]}))
339333

340334
(fx/defn show-profile
341335
{:events [:chat.ui/show-profile]}

src/status_im/data_store/chats.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
(dissoc :members)))
7272

7373
(fx/defn fetch-chats-rpc [cofx {:keys [on-success]}]
74-
{::json-rpc/call [{:method (json-rpc/call-ext-method "activeChats")
74+
{::json-rpc/call [{:method (json-rpc/call-ext-method "chats")
7575
:params []
7676
:on-success #(on-success (map <-rpc %))
7777
:on-failure #(log/error "failed to fetch chats" 0 -1 %)}]})

src/status_im/subs.cljs

+7
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,13 @@
780780
(fn [{:keys [synced-from]}]
781781
synced-from))
782782

783+
(re-frame/reg-sub
784+
:chats/muted
785+
(fn [[_ chat-id] _]
786+
(re-frame/subscribe [:chat-by-id chat-id]))
787+
(fn [{:keys [muted]}]
788+
muted))
789+
783790
(re-frame/reg-sub
784791
:chats/chat-type
785792
(fn [[_ chat-id] _]

src/status_im/ui/screens/profile/contact/views.cljs

+1-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
current-chat-id @(re-frame/subscribe [:chats/current-profile-chat])
161161
messages @(re-frame/subscribe [:chats/profile-messages-stream current-chat-id])
162162
no-messages? @(re-frame/subscribe [:chats/chat-no-messages? current-chat-id])
163-
muted? (:muted @(re-frame/subscribe [:chats/chat public-key]))
163+
muted? @(re-frame/subscribe [:chats/muted public-key])
164164
[first-name second-name] (multiaccounts/contact-two-names contact true)
165165
on-share #(re-frame/dispatch [:show-popover (merge
166166
{:view :share-chat-key
@@ -205,4 +205,3 @@
205205
:render-data {:chat-id current-chat-id}
206206
:render-fn status.views/render-message
207207
:data messages}]])))
208-

status-go-version.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
33
"owner": "status-im",
44
"repo": "status-go",
5-
"version": "v0.79.7",
6-
"commit-sha1": "60de443e89bd6a5d4f5b71e7038528d27f26090b",
7-
"src-sha256": "0gjgkqyvpbwg8drwi2mpcan5vxqrnrzl1j0ccmm2m8vq7j3b1332"
5+
"version": "v0.79.7+hotfix.1",
6+
"commit-sha1": "f27cc7ef218383984b3a1cc7cdb69e649cbeeca2",
7+
"src-sha256": "1xcby30rqiqcr05nrjv720ak3prgdcp3644sld8cbnxr1j0szd67"
88
}

0 commit comments

Comments
 (0)