Skip to content

Commit

Permalink
[#13355] Long time (5-15 sec) for loading chat messages
Browse files Browse the repository at this point in the history
  • Loading branch information
flexsurfer committed Jun 2, 2022
1 parent 117810c commit 519615b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/status_im/chat/models/loading.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@

(fx/defn handle-mark-all-read-successful
{:events [::mark-all-read-successful]}
[{:keys [db] :as cofx} chat-id]
(fx/merge cofx
{:db (mark-chat-all-read db chat-id)}
(notification-center/get-activity-center-notifications-count)))
[cofx]
(notification-center/get-activity-center-notifications-count cofx))

(fx/defn handle-mark-all-read-in-community-successful
{:events [::mark-all-read-in-community-successful]}
Expand All @@ -82,11 +80,12 @@
(fx/defn handle-mark-all-read
{:events [:chat.ui/mark-all-read-pressed :chat/mark-all-as-read]}
[{db :db} chat-id]
{:clear-message-notifications [[chat-id]
{:db (mark-chat-all-read db chat-id)
:clear-message-notifications [[chat-id]
(get-in db [:multiaccount :remote-push-notifications-enabled?])]
::json-rpc/call [{:method "wakuext_markAllRead"
:params [chat-id]
:on-success #(re-frame/dispatch [::mark-all-read-successful chat-id])}]})
:on-success #(re-frame/dispatch [::mark-all-read-successful])}]})

(fx/defn handle-mark-mark-all-read-in-community
{:events [:chat.ui/mark-all-read-in-community-pressed]}
Expand Down Expand Up @@ -157,8 +156,7 @@
(when (or first-request cursor)
(merge
{:db (assoc-in db [:pagination-info chat-id :loading-messages?] true)}
{:utils/dispatch-later [{:ms 100 :dispatch [:load-more-reactions cursor chat-id]}
{:ms 100 :dispatch [::models.pin-message/load-pin-messages chat-id]}]}
{:utils/dispatch-later [{:ms 100 :dispatch [:load-more-reactions cursor chat-id]}]}
(data-store.messages/messages-by-chat-id-rpc
chat-id
cursor
Expand All @@ -176,5 +174,7 @@
(when-not (get-in db [:pagination-info chat-id :messages-initialized?])
(fx/merge cofx
{:db (assoc-in db [:pagination-info chat-id :messages-initialized?] now)
:utils/dispatch-later [{:ms 500 :dispatch [:chat.ui/mark-all-read-pressed chat-id]}]}
:utils/dispatch-later [{:ms 50 :dispatch [:chat.ui/mark-all-read-pressed chat-id]}
(when-not (get-in cofx [:db :chats chat-id :public?])
{:ms 100 :dispatch [::models.pin-message/load-pin-messages chat-id]})]}
(load-more-messages chat-id true))))
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.100.0",
"commit-sha1": "1bfde4c4cc69292875ae9fdc41a8b4bd29e95a7a",
"src-sha256": "1nkk7dsqz1x31n305p33jdwpqr9bm7ajkqs3khq5l4ag3njagbrh"
"version": "bug/slow-mark-read-3",
"commit-sha1": "d35fab771a2dc44907768627ad862006483a7a18",
"src-sha256": "1a10mrqy75888m3p3fj7077474vzfpl4s4rz11l9vg9gaamr0dvm"
}

0 comments on commit 519615b

Please sign in to comment.