diff --git a/src/status_im/contexts/profile/logout/events.cljs b/src/status_im/contexts/profile/logout/events.cljs index 7ce50732cf..35b4559e18 100644 --- a/src/status_im/contexts/profile/logout/events.cljs +++ b/src/status_im/contexts/profile/logout/events.cljs @@ -14,8 +14,11 @@ network/status network/expensive? centralized-metrics/user-confirmed?] network-type :network/network-type - :as _db}] + :as db}] (assoc db/app-db + ;; We must carry over the current `:selected-stack-id`, otherwise the + ;; app will start with `:view-id` as nil. + :shell/selected-stack-id (:shell/selected-stack-id db) :profile/logging-out? true :centralized-metrics/user-confirmed? user-confirmed? :network/type network-type @@ -44,4 +47,3 @@ [:dispatch-later {:ms 100 :dispatch [:profile.logout/reset-state]}]]})) - diff --git a/src/status_im/core.cljs b/src/status_im/core.cljs index 96df7d277b..a4f94ae769 100644 --- a/src/status_im/core.cljs +++ b/src/status_im/core.cljs @@ -9,7 +9,6 @@ [native-module.core :as native-module] [re-frame.core :as re-frame] [re-frame.interop :as interop] - [react-native.async-storage :as async-storage] [react-native.core :as rn] [react-native.platform :as platform] [react-native.shake :as react-native-shake] @@ -60,9 +59,6 @@ (universal-links/initialize) (interceptors/register-global-interceptors) - ;; Shell - (async-storage/get-item :selected-stack-id #(re-frame/dispatch [:shell/change-tab %])) - (when config/quo-preview-enabled? (ff/load-flags)) diff --git a/src/status_im/events.cljs b/src/status_im/events.cljs index 03c980309d..0689ca75c7 100644 --- a/src/status_im/events.cljs +++ b/src/status_im/events.cljs @@ -62,6 +62,9 @@ (rf/merge cofx {:db db/app-db + :effects.async-storage/get {:keys [:selected-stack-id] + :cb (fn [{:keys [selected-stack-id]}] + (rf/dispatch [:shell/change-tab selected-stack-id]))} :theme/init-theme nil :effects.network/listen-to-network-info nil :effects.biometric/get-supported-type nil