[#4158] Fix New messages counter being shown for already seen messages
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
parent
386c678caf
commit
234a51c97e
|
@ -246,7 +246,8 @@
|
||||||
{:db (-> (assoc db :current-chat-id chat-id)
|
{:db (-> (assoc db :current-chat-id chat-id)
|
||||||
(set-chat-ui-props {:validation-messages nil}))}
|
(set-chat-ui-props {:validation-messages nil}))}
|
||||||
(contact-code/listen-to-chat chat-id)
|
(contact-code/listen-to-chat chat-id)
|
||||||
(mark-messages-seen chat-id))))
|
(when platform/desktop?
|
||||||
|
(mark-messages-seen chat-id)))))
|
||||||
|
|
||||||
(fx/defn navigate-to-chat
|
(fx/defn navigate-to-chat
|
||||||
"Takes coeffects map and chat-id, returns effects necessary for navigation and preloading data"
|
"Takes coeffects map and chat-id, returns effects necessary for navigation and preloading data"
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
status-im.utils.keychain.events
|
status-im.utils.keychain.events
|
||||||
[re-frame.core :as re-frame]
|
[re-frame.core :as re-frame]
|
||||||
[status-im.hardwallet.core :as hardwallet]
|
[status-im.hardwallet.core :as hardwallet]
|
||||||
|
[status-im.chat.models :as chat]
|
||||||
[status-im.native-module.core :as status]
|
[status-im.native-module.core :as status]
|
||||||
[status-im.mailserver.core :as mailserver]
|
[status-im.mailserver.core :as mailserver]
|
||||||
[status-im.ui.components.permissions :as permissions]
|
[status-im.ui.components.permissions :as permissions]
|
||||||
|
@ -73,6 +74,11 @@
|
||||||
:http-post
|
:http-post
|
||||||
http-post)
|
http-post)
|
||||||
|
|
||||||
|
(defn- mark-messages-seen
|
||||||
|
[{:keys [db] :as cofx}]
|
||||||
|
(let [{:keys [current-chat-id]} db]
|
||||||
|
(chat/mark-messages-seen cofx current-chat-id)))
|
||||||
|
|
||||||
(defn- http-raw-post [{:keys [url body response-validator success-event-creator failure-event-creator timeout-ms opts]}]
|
(defn- http-raw-post [{:keys [url body response-validator success-event-creator failure-event-creator timeout-ms opts]}]
|
||||||
(let [on-success #(re-frame/dispatch (success-event-creator %))
|
(let [on-success #(re-frame/dispatch (success-event-creator %))
|
||||||
on-error (when failure-event-creator #(re-frame/dispatch (failure-event-creator %)))
|
on-error (when failure-event-creator #(re-frame/dispatch (failure-event-creator %)))
|
||||||
|
@ -190,4 +196,5 @@
|
||||||
:hardwallet-connect (hardwallet/hardwallet-connect-screen-did-load %)
|
:hardwallet-connect (hardwallet/hardwallet-connect-screen-did-load %)
|
||||||
:hardwallet-authentication-method (hardwallet/authentication-method-screen-did-load %)
|
:hardwallet-authentication-method (hardwallet/authentication-method-screen-did-load %)
|
||||||
:accounts (hardwallet/accounts-screen-did-load %)
|
:accounts (hardwallet/accounts-screen-did-load %)
|
||||||
|
:chat (mark-messages-seen %)
|
||||||
nil))))
|
nil))))
|
||||||
|
|
Loading…
Reference in New Issue