diff --git a/src/status_im/common/enter_seed_phrase/view.cljs b/src/status_im/common/enter_seed_phrase/view.cljs index 0de0ed64d2c..33ca0ded852 100644 --- a/src/status_im/common/enter_seed_phrase/view.cljs +++ b/src/status_im/common/enter_seed_phrase/view.cljs @@ -228,9 +228,6 @@ (defn view [] (let [{:keys [on-success]} (rf/sub [:get-screen-params])] - (rn/use-unmount - (when-not on-success - #(rf/dispatch [:onboarding/clear-navigated-to-enter-seed-phrase-from-screen]))) [screen {:title (i18n/label :t/use-recovery-phrase) :on-success on-success}])) diff --git a/src/status_im/contexts/onboarding/create_or_sync_profile/view.cljs b/src/status_im/contexts/onboarding/create_or_sync_profile/view.cljs index 0d25b3b1c38..a51d2da764b 100644 --- a/src/status_im/contexts/onboarding/create_or_sync_profile/view.cljs +++ b/src/status_im/contexts/onboarding/create_or_sync_profile/view.cljs @@ -17,14 +17,14 @@ (defn- navigate-to-create-profile [] (debounce/throttle-and-dispatch - [:onboarding/navigate-to-create-profile] + [:navigate-to :screen/onboarding.create-profile] 1000)) (defn- navigate-to-sign-in-by-syncing [] (rf/dispatch [:syncing/clear-syncing-fallback-flow]) (debounce/throttle-and-dispatch - [:onboarding/navigate-to-sign-in-by-syncing] + [:navigate-to :screen/onboarding.sign-in-intro] 1000)) (defn- show-check-before-syncing @@ -38,10 +38,7 @@ (defn- navigate-to-sign-in-by-recovery-phrase [create-profile?] (rf/dispatch [:syncing/clear-syncing-fallback-flow]) - (rf/dispatch [:onboarding/navigate-to-sign-in-by-seed-phrase - (if create-profile? - :screen/onboarding.new-to-status - :screen/onboarding.sync-or-recover-profile)])) + (rf/dispatch [:navigate-to :screen/onboarding.enter-seed-phrase])) (defn- option-card-max-height [window-height] diff --git a/src/status_im/contexts/onboarding/enable_biometrics/view.cljs b/src/status_im/contexts/onboarding/enable_biometrics/view.cljs index cc59f2d1b29..17e13581cbb 100644 --- a/src/status_im/contexts/onboarding/enable_biometrics/view.cljs +++ b/src/status_im/contexts/onboarding/enable_biometrics/view.cljs @@ -40,9 +40,7 @@ :background :blur :type :grey :on-press #(rf/dispatch (if syncing-results? - [:navigate-to-within-stack - [:screen/onboarding.enable-notifications - :screen/onboarding.enable-biometrics]] + [:navigate-to :screen/onboarding.enable-notifications] [:onboarding/create-account-and-login])) :container-style {:margin-top 12}} (i18n/label :t/maybe-later)]])) diff --git a/src/status_im/contexts/onboarding/events.cljs b/src/status_im/contexts/onboarding/events.cljs index 834a84ffe68..63631a35318 100644 --- a/src/status_im/contexts/onboarding/events.cljs +++ b/src/status_im/contexts/onboarding/events.cljs @@ -24,13 +24,8 @@ (rf/reg-event-fx :onboarding/profile-data-set (fn [{:keys [db]} [onboarding-data]] - (let [navigate-from-screen (get db - :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)] - {:db (update db :onboarding/profile merge onboarding-data) - :fx [[:dispatch - [:navigate-to-within-stack - [:screen/onboarding.create-profile-password navigate-from-screen]]]]}))) + {:db (update db :onboarding/profile merge onboarding-data) + :fx [[:dispatch [:navigate-to :screen/onboarding.create-profile-password]]]})) (rf/defn enable-biometrics {:events [:onboarding/enable-biometrics]} @@ -40,30 +35,6 @@ {:on-success #(rf/dispatch [:onboarding/biometrics-done]) :on-fail #(rf/dispatch [:onboarding/biometrics-fail %])}]]]}) -(rf/reg-event-fx :onboarding/navigate-to-sign-in-by-seed-phrase - (fn [{:keys [db]} [from-screen]] - {:db (assoc db :onboarding/navigated-to-enter-seed-phrase-from-screen from-screen) - :fx [[:dispatch [:navigate-to-within-stack [:screen/onboarding.enter-seed-phrase from-screen]]]]})) - -(rf/reg-event-fx - :onboarding/clear-navigated-to-enter-seed-phrase-from-screen - (fn [{:keys [db]}] - {:db (dissoc db :onboarding/navigated-to-enter-seed-phrase-from-screen)})) - -(rf/reg-event-fx :onboarding/navigate-to-enable-notifications-from-syncing - (fn [{:keys [db]}] - {:db (dissoc db :onboarding/profile) - :dispatch [:navigate-to-within-stack - [:screen/onboarding.enable-notifications :screen/onboarding.enable-biometrics]]})) - -(rf/reg-event-fx :onboarding/navigate-to-enable-notifications - (fn [{:keys [db]}] - {:dispatch [:navigate-to-within-stack - [:screen/onboarding.enable-notifications - (get db - :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)]]})) - (rf/defn biometrics-done {:events [:onboarding/biometrics-done]} [{:keys [db]}] @@ -87,12 +58,7 @@ (= (:syncing/key-uid db) (get-in db [:onboarding/profile :key-uid])))] (rf/merge cofx - {:fx [[:dispatch - [:navigate-to-within-stack - [:screen/onboarding.preparing-status - (get db - :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)]]] + {:fx [[:dispatch [:navigate-to :screen/onboarding.preparing-status]] (when-not syncing-account-recovered? [:dispatch [:syncing/clear-syncing-installation-id]])] :db (-> db @@ -121,11 +87,7 @@ (assoc-in [:onboarding/profile :auth-method] constants/auth-method-password)) :fx [[:dispatch (if biometric-supported-type - [:navigate-to-within-stack - [:screen/onboarding.enable-biometrics - (get db - :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)]] + [:navigate-to :screen/onboarding.enable-biometrics] [:onboarding/create-account-and-login])]]}))) (rf/defn navigate-to-enable-biometrics @@ -159,26 +121,7 @@ (assoc-in [:onboarding/profile :key-uid] key-uid) (assoc-in [:onboarding/profile :color] constants/profile-default-color)) :fx [[:dispatch - [:navigate-to-within-stack - [next-screen - (get db - :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)]]]]}))) - -(rf/defn navigate-to-create-profile - {:events [:onboarding/navigate-to-create-profile]} - [{:keys [db]}] - ;; Restart the flow - {:db (dissoc db :onboarding/profile) - :dispatch [:navigate-to-within-stack - [:screen/onboarding.create-profile :screen/onboarding.new-to-status]]}) - -(rf/reg-event-fx :onboarding/navigate-to-sign-in-by-syncing - (fn [{:keys [db]}] - ;; Restart the flow - {:db (dissoc db :onboarding/profile) - :dispatch [:navigate-to-within-stack - [:screen/onboarding.sign-in-intro :screen/onboarding.sync-or-recover-profile]]})) + [:navigate-to next-screen]]]}))) (rf/reg-event-fx :onboarding/set-auth-method (fn [{:keys [db]} [auth-method]] @@ -203,7 +146,7 @@ (rf/dispatch [:onboarding/set-auth-method auth-method]) (when syncing? (rf/dispatch - [:onboarding/navigate-to-enable-notifications-from-syncing]))) + [:navigate-to :screen/onboarding.enable-notifications]))) :on-error #(log/error "failed to save biometrics" {:key-uid key-uid :error %})})))) diff --git a/src/status_im/contexts/onboarding/syncing/progress/view.cljs b/src/status_im/contexts/onboarding/syncing/progress/view.cljs index 08aa1256a03..3c1dc496088 100644 --- a/src/status_im/contexts/onboarding/syncing/progress/view.cljs +++ b/src/status_im/contexts/onboarding/syncing/progress/view.cljs @@ -30,8 +30,7 @@ [] (rf/dispatch [:syncing/set-syncing-fallback-flow]) (debounce/debounce-and-dispatch - [:onboarding/navigate-to-sign-in-by-seed-phrase :screen/onboarding.sync-or-recover-profile] - 500)) + [:navigate-to :screen/onboarding.enter-seed-phrase] 500)) (defn- try-again [logged-in?]