diff --git a/src/status_im/constants.cljs b/src/status_im/constants.cljs index 3a6c88d007..f201f2443f 100644 --- a/src/status_im/constants.cljs +++ b/src/status_im/constants.cljs @@ -450,7 +450,6 @@ (def ^:const biometrics-type-touch-id :TouchID) (def ^:const biometrics-type-face-id :FaceID) -(def ^:const onboarding-generating-keys-animation-duration-ms 7000) (def ^:const onboarding-generating-keys-navigation-retry-ms 3000) (def ^:const image-description-in-lightbox? false) diff --git a/src/status_im/contexts/onboarding/common/background/view.cljs b/src/status_im/contexts/onboarding/common/background/view.cljs index c34d284a94..ca9d926332 100644 --- a/src/status_im/contexts/onboarding/common/background/view.cljs +++ b/src/status_im/contexts/onboarding/common/background/view.cljs @@ -67,7 +67,7 @@ (fn [] (reanimated/set-shared-value @paused? (not= view-id :screen/onboarding.intro)) (fn [] - (when (= view-id :screen/onboarding.generating-keys) + (when (= view-id :screen/onboarding.preparing-status) (carousel.animation/cleanup-animation progress paused?)))) [view-id]) diff --git a/src/status_im/contexts/onboarding/events.cljs b/src/status_im/contexts/onboarding/events.cljs index e661c8487b..3257ae0158 100644 --- a/src/status_im/contexts/onboarding/events.cljs +++ b/src/status_im/contexts/onboarding/events.cljs @@ -67,28 +67,6 @@ (fn [_ [error]] {:dispatch [:biometric/show-message (ex-cause error)]})) -;; Navigate to next screen once onboarding animation and account creation both are complete -;; Note: If account creation fails, user will get stuck on loading screen -;; TODO: Show error screen in case account creation/restoration fails -(rf/reg-event-fx :onboarding/account-creation-complete - (fn [{:keys [db]} [opts]] - (let [loading-animation-complete? (or (:loading-animation-complete? opts) - (:onboarding/loading-animation-complete? db)) - loading-screen (or (:loading-screen opts) (:onboarding/loading-screen db)) - login-signal-received? (or (:login-signal-received? opts) - (:onboarding/login-signal-received? db))] - (if (and loading-animation-complete? login-signal-received?) - {:db (-> db - (dissoc :onboarding/loading-screen) - (dissoc :onboarding/loading-animation-complete?) - (dissoc :onboarding/login-signal-received?)) - :fx [[:dispatch - [:navigate-to-within-stack [:screen/onboarding.enable-notifications loading-screen]]]]} - {:db (-> db - (assoc :onboarding/loading-screen loading-screen) - (assoc :onboarding/loading-animation-complete? loading-animation-complete?) - (assoc :onboarding/login-signal-received? login-signal-received?))})))) - (rf/defn create-account-and-login {:events [:onboarding/create-account-and-login]} [{:keys [db] :as cofx}] @@ -96,27 +74,20 @@ (:onboarding/profile db) syncing-account-recovered? (and (seq (:syncing/key-uid db)) (= (:syncing/key-uid db) - (get-in db [:onboarding/profile :key-uid]))) - loading-screen (if syncing-account-recovered? - :screen/onboarding.preparing-status - :screen/onboarding.generating-keys)] + (get-in db [:onboarding/profile :key-uid])))] (rf/merge cofx - {:fx [[:dispatch - [:navigate-to-within-stack - [loading-screen - (get db - :onboarding/navigated-to-enter-seed-phrase-from-screen - :screen/onboarding.new-to-status)]]] - (when-not syncing-account-recovered? - [:dispatch [:syncing/clear-syncing-installation-id]])] - :dispatch-later [{:ms constants/onboarding-generating-keys-animation-duration-ms - :dispatch [:onboarding/account-creation-complete - {:loading-animation-complete? true - :loading-screen loading-screen}]}] - :db (-> db - (dissoc :profile/login) - (dissoc :auth-method) - (assoc :onboarding/new-account? true))} + {: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)]]] + (when-not syncing-account-recovered? + [:dispatch [:syncing/clear-syncing-installation-id]])] + :db (-> db + (dissoc :profile/login) + (dissoc :auth-method) + (assoc :onboarding/new-account? true))} (if seed-phrase (profile.recover/recover-profile-and-login profile) (profile.create/create-profile-and-login profile))))) diff --git a/src/status_im/contexts/onboarding/generating_keys/style.cljs b/src/status_im/contexts/onboarding/generating_keys/style.cljs deleted file mode 100644 index 4fd248b28e..0000000000 --- a/src/status_im/contexts/onboarding/generating_keys/style.cljs +++ /dev/null @@ -1,17 +0,0 @@ -(ns status-im.contexts.onboarding.generating-keys.style) - -(defn page-container - [insets] - {:flex 1 - :padding-top (:top insets)}) - -(defn page-illustration - [width] - {:flex 1 - :width width}) - -(def title-style - {:position :absolute - :left 0 - :right 0 - :top 0}) diff --git a/src/status_im/contexts/onboarding/generating_keys/view.cljs b/src/status_im/contexts/onboarding/generating_keys/view.cljs deleted file mode 100644 index 7877b96fa6..0000000000 --- a/src/status_im/contexts/onboarding/generating_keys/view.cljs +++ /dev/null @@ -1,105 +0,0 @@ -(ns status-im.contexts.onboarding.generating-keys.view - (:require - [quo.core :as quo] - [react-native.core :as rn] - [react-native.reanimated :as reanimated] - [react-native.safe-area :as safe-area] - [status-im.common.resources :as resources] - [status-im.contexts.onboarding.generating-keys.style :as style] - [utils.i18n :as i18n])) - -(def first-title-display-time 3000) -(def second-title-start-time 3500) -(def second-title-display-time 1000) -(def third-title-start-time 5500) -(def transition-duration-time 500) - -(defn generate-keys-title - [] - [quo/text-combinations - {:container-style {:margin-horizontal 20 - :margin-vertical 12} - :title (i18n/label :t/generating-keys)}]) - -(defn saving-keys-title - [] - [quo/text-combinations - {:container-style {:margin-horizontal 20 - :margin-vertical 12} - :title (i18n/label :t/saving-keys-to-device)}]) - -(defn keys-saved-title - [] - [quo/text-combinations - {:container-style {:margin-horizontal 20 - :margin-vertical 12} - :title (i18n/label :t/keys-saved)}]) - -(defn sequence-animation - [generate-keys-opacity saving-keys-opacity keys-saved-opacity] - (reanimated/set-shared-value generate-keys-opacity - (reanimated/with-delay - first-title-display-time - (reanimated/with-timing 0 - (js-obj "duration" transition-duration-time - "easing" (:linear - reanimated/easings))))) - (reanimated/set-shared-value - saving-keys-opacity - (reanimated/with-sequence - (reanimated/with-delay second-title-start-time - (reanimated/with-timing 1 - (js-obj "duration" transition-duration-time - "easing" (:linear reanimated/easings)))) - (reanimated/with-delay second-title-display-time - (reanimated/with-timing 0 - (js-obj "duration" transition-duration-time - "easing" (:linear reanimated/easings)))))) - (reanimated/set-shared-value keys-saved-opacity - (reanimated/with-delay - third-title-start-time - (reanimated/with-timing 1 - (js-obj "duration" transition-duration-time - "easing" (:linear - reanimated/easings)))))) - -(defn title - [] - (let [generate-keys-opacity (reanimated/use-shared-value 1) - saving-keys-opacity (reanimated/use-shared-value 0) - keys-saved-opacity (reanimated/use-shared-value 0)] - (sequence-animation generate-keys-opacity saving-keys-opacity keys-saved-opacity) - [rn/view - {:style {:margin-top 56 - :height 56}} - [reanimated/view - {:style (reanimated/apply-animations-to-style - {:opacity generate-keys-opacity} - style/title-style)} - [generate-keys-title]] - [reanimated/view - {:style (reanimated/apply-animations-to-style - {:opacity saving-keys-opacity} - style/title-style)} - [saving-keys-title]] - [reanimated/view - {:style (reanimated/apply-animations-to-style - {:opacity keys-saved-opacity} - style/title-style)} - [keys-saved-title]]])) - -(defn content - [] - (let [width (:width (rn/get-window))] - [rn/image - {:resize-mode :contain - :style (style/page-illustration width) - :source (resources/get-image :generate-keys1)}])) - -(defn view - [] - (let [insets (safe-area/get-insets)] - [rn/view {:style (style/page-container insets)} - [:<> - [title] - [content]]])) diff --git a/src/status_im/contexts/onboarding/preparing_status/view.cljs b/src/status_im/contexts/onboarding/preparing_status/view.cljs index 81ddf5c45f..73dba22d8c 100644 --- a/src/status_im/contexts/onboarding/preparing_status/view.cljs +++ b/src/status_im/contexts/onboarding/preparing_status/view.cljs @@ -4,7 +4,7 @@ [react-native.core :as rn] [react-native.safe-area :as safe-area] [status-im.common.resources :as resources] - [status-im.contexts.onboarding.generating-keys.style :as style] + [status-im.contexts.onboarding.preparing-status.style :as style] [utils.i18n :as i18n])) (defn title @@ -16,7 +16,7 @@ [quo/text-combinations {:container-style {:margin-horizontal 20 :margin-vertical 12} - :title (i18n/label :t/preparing-app-for-you) + :title (i18n/label :t/preparing-status-for-you) :description (i18n/label :t/hang-in-there)}]]) (defn content diff --git a/src/status_im/contexts/profile/login/events.cljs b/src/status_im/contexts/profile/login/events.cljs index 9b560f779c..f088e0195f 100644 --- a/src/status_im/contexts/profile/login/events.cljs +++ b/src/status_im/contexts/profile/login/events.cljs @@ -85,7 +85,10 @@ (get db :onboarding/new-account?) [[:dispatch [:onboarding/finalize-setup]] - [:dispatch [:onboarding/account-creation-complete {:login-signal-received? true}]]] + [:dispatch + [:navigate-to-within-stack + [:screen/onboarding.enable-notifications + :screen/onboarding.preparing-status]]]] :else [[:dispatch [:update-theme-and-init-root :shell-stack]] diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index 7a19c7950c..3499167c4c 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -45,7 +45,6 @@ [status-im.contexts.onboarding.create-profile.view :as create-profile] [status-im.contexts.onboarding.enable-biometrics.view :as enable-biometrics] [status-im.contexts.onboarding.enable-notifications.view :as enable-notifications] - [status-im.contexts.onboarding.generating-keys.view :as generating-keys] [status-im.contexts.onboarding.identifiers.view :as identifiers] [status-im.contexts.onboarding.intro.view :as intro] [status-im.contexts.onboarding.preparing-status.view :as preparing-status] @@ -761,17 +760,6 @@ :popStackOnPress false}} :component enable-biometrics/view}) -(def onboarding-generating-keys - {:name :screen/onboarding.generating-keys - :metrics {:track? true} - :options {:theme :dark - :layout options/onboarding-transparent-layout - :animations transitions/push-animations-for-transparent-background - :popGesture false - :hardwareBackButton {:dismissModalOnPress false - :popStackOnPress false}} - :component generating-keys/view}) - (def onboarding-preparing-status {:name :screen/onboarding.preparing-status :metrics {:track? true} @@ -872,7 +860,6 @@ onboarding-create-profile onboarding-create-profile-password onboarding-enable-biometrics - onboarding-generating-keys onboarding-preparing-status onboarding-entering-seed-phrase onboarding-enable-notifications diff --git a/translations/en.json b/translations/en.json index c829603ad3..3874173d30 100644 --- a/translations/en.json +++ b/translations/en.json @@ -1975,7 +1975,7 @@ "powered-by-paraswap": "Powered by Paraswap", "preference": "Preference", "preferred-by-receiver": "Preferred by receiver", - "preparing-app-for-you": "Preparing app for you...", + "preparing-status-for-you": "Preparing Status for you...", "press": "Press", "preview-privacy": "Preview privacy mode", "previewing-may-share-metadata": "Previewing links from these websites may share your metadata with their owners",