From a5c81824613ca931e9a770506b1d1c4f686cd58e Mon Sep 17 00:00:00 2001 From: John Ngei Date: Tue, 23 Jul 2024 15:18:43 +0200 Subject: [PATCH] fix onboarding navigation to enable notification screen and blur issues (#20725) --- .../onboarding/enable_notifications/view.cljs | 4 ++-- src/status_im/contexts/onboarding/events.cljs | 15 +++------------ src/status_im/navigation/roots.cljs | 9 --------- src/status_im/navigation/screens.cljs | 14 +++++++++----- 4 files changed, 14 insertions(+), 28 deletions(-) diff --git a/src/status_im/contexts/onboarding/enable_notifications/view.cljs b/src/status_im/contexts/onboarding/enable_notifications/view.cljs index 0c043b8081..54caa8777b 100644 --- a/src/status_im/contexts/onboarding/enable_notifications/view.cljs +++ b/src/status_im/contexts/onboarding/enable_notifications/view.cljs @@ -38,7 +38,7 @@ (rf/dispatch [:push-notifications/switch true]) (rf/dispatch [:navigate-to-within-stack [:screen/onboarding.welcome - :screen/onboarding.enable-notifications]])) + :screen/onboarding.generating-keys]])) :type :primary :icon-left :i/notifications :accessibility-label :enable-notifications-button @@ -52,7 +52,7 @@ nil) (rf/dispatch [:navigate-to-within-stack [:screen/onboarding.welcome - :screen/onboarding.enable-notifications]])) + :screen/onboarding.generating-keys]])) :accessibility-label :enable-notifications-later-button :type :grey :background :blur diff --git a/src/status_im/contexts/onboarding/events.cljs b/src/status_im/contexts/onboarding/events.cljs index b5a5a75a7f..e368cabdbb 100644 --- a/src/status_im/contexts/onboarding/events.cljs +++ b/src/status_im/contexts/onboarding/events.cljs @@ -73,7 +73,9 @@ :onboarding/navigated-to-enter-seed-phrase-from-screen :screen/onboarding.new-to-status)]] :dispatch-later [{:ms constants/onboarding-generating-keys-animation-duration-ms - :dispatch [:init-root :screen/onboarding.enable-notifications]}] + :dispatch [:navigate-to-within-stack + [:screen/onboarding.enable-notifications + :screen/onboarding.generating-keys]]}] :db (-> db (dissoc :profile/login) (dissoc :auth-method) @@ -187,14 +189,3 @@ {:key-uid key-uid :error %})})))) -(rf/defn navigate-to-identifiers - {:events [:onboarding/navigate-to-identifiers]} - [{:keys [db]}] - (if (:onboarding/generated-keys? db) - {:dispatch [:navigate-to-within-stack - [:screen/onboarding.identifiers - (get db - :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)]]} - {:dispatch-later [{:ms constants/onboarding-generating-keys-navigation-retry-ms - :dispatch [:onboarding/navigate-to-identifiers]}]})) diff --git a/src/status_im/navigation/roots.cljs b/src/status_im/navigation/roots.cljs index 65268e8228..6c938f8b6b 100644 --- a/src/status_im/navigation/roots.cljs +++ b/src/status_im/navigation/roots.cljs @@ -37,15 +37,6 @@ :id :screen/profile.profiles :options (options/dark-root-options)}}]}}} - :screen/onboarding.enable-notifications - {:root {:stack {:children [{:component {:name :screen/onboarding.enable-notifications - :id :screen/onboarding.enable-notifications - :options (options/dark-root-options)}}]}}} - - :screen/onboarding.welcome - {:root {:stack {:children [{:component {:name :screen/onboarding.welcome - :id :screen/onboarding.welcome - :options (options/dark-root-options)}}]}}} :screen/onboarding.syncing-results {:root {:stack {:children [{:component {:name :screen/onboarding.syncing-results :id :screen/onboarding.syncing-results diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index a0c97cf949..4b8f0708bd 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -348,11 +348,15 @@ :component enter-seed-phrase/view} {:name :screen/onboarding.enable-notifications - :options {:theme :dark - :layout options/onboarding-transparent-layout - :animations (merge - transitions/new-to-status-modal-animations - transitions/push-animations-for-transparent-background)} + :options {:theme :dark + :layout options/onboarding-transparent-layout + :animations (merge + transitions/new-to-status-modal-animations + transitions/push-animations-for-transparent-background) + :popGesture false + :modalPresentationStyle :overCurrentContext + :hardwareBackButton {:dismissModalOnPress false + :popStackOnPress false}} :component enable-notifications/view} {:name :screen/onboarding.identifiers