diff --git a/src/status_im/multiaccounts/create/core.cljs b/src/status_im/multiaccounts/create/core.cljs index c7a67e3cb2..7630fd4f43 100644 --- a/src/status_im/multiaccounts/create/core.cljs +++ b/src/status_im/multiaccounts/create/core.cljs @@ -109,7 +109,7 @@ (fx/defn intro-step-forward {:events [:intro-wizard/step-forward-pressed]} [{:keys [db] :as cofx} {:keys [skip?] :as opts}] - (let [{:keys [step first-time-setup? selected-storage-type]} (:intro-wizard db)] + (let [{:keys [step first-time-setup? selected-storage-type processing?]} (:intro-wizard db)] (cond (confirm-failure? db) (on-confirm-failure cofx) @@ -128,15 +128,19 @@ (store-key-code cofx) (and (= step :confirm-code) - (not (:multiaccounts/login db))) - (create-multiaccount cofx) + (not (:multiaccounts/login db)) + (not processing?)) + (fx/merge cofx + {:db (assoc-in db [:intro-wizard :processing?] true)} + create-multiaccount) (and (= step :select-key-storage) (= :advanced selected-storage-type)) {:dispatch [:keycard/start-onboarding-flow]} - :else {:db (assoc-in db [:intro-wizard :step] - (inc-step step))}))) + :else {:db (update db :intro-wizard + assoc :processing? false + :step (inc-step step))}))) (defn prepare-subaccounts-data [multiaccount] diff --git a/src/status_im/ui/screens/intro/views.cljs b/src/status_im/ui/screens/intro/views.cljs index 8b672fcfb9..8badaf381f 100644 --- a/src/status_im/ui/screens/intro/views.cljs +++ b/src/status_im/ui/screens/intro/views.cljs @@ -204,8 +204,16 @@ (defn create-code [{:keys [confirm-failure?] :as wizard-state} view-width] [password-container confirm-failure? view-width]) -(defn confirm-code [{:keys [confirm-failure?] :as wizard-state} view-width] - [password-container confirm-failure? view-width]) +(defn confirm-code [{:keys [confirm-failure? processing?] :as wizard-state} view-width] + (if processing? + [react/view {:style {:justify-content :center + :align-items :center}} + [react/activity-indicator {:size :large + :animating true}] + [react/text {:style {:color colors/gray + :margin-top 8}} + (i18n/label :t/processing)]] + [password-container confirm-failure? view-width])) (defn enable-fingerprint [] [vector-icons/icon :main-icons/fingerprint @@ -218,7 +226,8 @@ :justify-content :center} :width 66 :height 64}]) -(defn bottom-bar [{:keys [step generating-keys? weak-password? encrypt-with-password?] :as wizard-state}] +(defn bottom-bar [{:keys [step generating-keys? weak-password? encrypt-with-password? + processing?] :as wizard-state}] [react/view {:style {:margin-bottom (if (or (#{:choose-key :select-key-storage} step) (and (#{:create-code :confirm-code} step) encrypt-with-password?)) @@ -248,7 +257,8 @@ [react/view {:style styles/bottom-arrow} [components.common/bottom-button {:on-press #(re-frame/dispatch [:intro-wizard/step-forward-pressed]) - :disabled? (and (= step :create-code) weak-password?) + :disabled? (or processing? + (and (= step :create-code) weak-password?)) :forward? true}]]) (when (#{:enable-fingerprint :enable-notifications} step) [components.common/button {:button-style (assoc styles/bottom-button :margin-top 20)