[#13235] Fix opening of the last shown chat with activated local notifications

This commit is contained in:
Roman Volosovskyi 2022-04-05 10:45:46 +02:00
parent ba38f3ec74
commit 4036e21f17
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
2 changed files with 9 additions and 2 deletions

View File

@ -415,6 +415,11 @@
(when (= stored-key-uid key-uid)
(re-frame/dispatch [:chat.ui/navigate-to-chat chat-id])))))))))
(fx/defn check-last-chat
{:events [::check-last-chat]}
[{:keys [db]}]
{::open-last-chat (get-in db [:multiaccount :key-uid])})
(fx/defn get-chats-callback
{:events [::get-chats-callback]}
[{:keys [db] :as cofx}]

View File

@ -13,7 +13,8 @@
[status-im.ui.screens.views :as views]
[status-im.utils.fx :as fx]
[status-im.utils.platform :as platform]
[taoensso.timbre :as log]))
[taoensso.timbre :as log]
[status-im.multiaccounts.login.core :as login-core]))
(def debug? ^boolean js/goog.DEBUG)
@ -206,7 +207,8 @@
(re-frame/dispatch-sync [::set-multiaccount-root])
(when @root-id
(reset! root-comp-id @root-id)
(.setRoot Navigation (clj->js (get (roots/roots) @root-id)))))
(.setRoot Navigation (clj->js (get (roots/roots) @root-id)))
(re-frame/dispatch [::login-core/check-last-chat])))
(.hide ^js splash-screen))))
(defn get-screen-component [comp]