diff --git a/src/status_im/accounts/create/core.cljs b/src/status_im/accounts/create/core.cljs index 0fd75ad202..ec3398e0f1 100644 --- a/src/status_im/accounts/create/core.cljs +++ b/src/status_im/accounts/create/core.cljs @@ -99,10 +99,18 @@ :enter-password (navigation/navigate-back cofx) :confirm-password (reset-account-creation cofx))) +(defn navigate-to-create-account-screen [{:keys [db] :as cofx}] + (handlers-macro/merge-fx cofx + {:db (update db :accounts/create + #(-> % + (assoc :step :enter-password) + (dissoc :password :password-confirm :name :error)))} + (navigation/navigate-to-cofx :create-account nil))) + (defn navigate-to-authentication-method [{:keys [db] :as cofx}] (if (hardwallet/hardwallet-supported? db) (navigation/navigate-to-cofx :hardwallet/authentication-method nil cofx) - (navigation/navigate-to-cofx :create-account nil cofx))) + (navigate-to-create-account-screen cofx))) ;;;; COFX diff --git a/src/status_im/events.cljs b/src/status_im/events.cljs index 6f8eb42c93..ca2770e92c 100644 --- a/src/status_im/events.cljs +++ b/src/status_im/events.cljs @@ -1,6 +1,5 @@ (ns status-im.events - (:require status-im.ui.screens.accounts.create.navigation - status-im.ui.screens.accounts.recover.navigation + (:require status-im.ui.screens.accounts.recover.navigation [re-frame.core :as re-frame] [status-im.accounts.core :as accounts] [status-im.accounts.create.core :as accounts.create] @@ -510,6 +509,11 @@ (fn [cofx _] (hardwallet/navigate-to-connect-screen cofx))) +(handlers/register-handler-fx + :hardwallet.ui/password-option-pressed + (fn [cofx _] + (accounts.create/navigate-to-create-account-screen cofx))) + (handlers/register-handler-fx :hardwallet.ui/go-to-settings-button-pressed (fn [_ _] diff --git a/src/status_im/ui/screens/accounts/create/navigation.cljs b/src/status_im/ui/screens/accounts/create/navigation.cljs deleted file mode 100644 index 57ec659a56..0000000000 --- a/src/status_im/ui/screens/accounts/create/navigation.cljs +++ /dev/null @@ -1,9 +0,0 @@ -(ns status-im.ui.screens.accounts.create.navigation - (:require [status-im.ui.screens.navigation :as nav])) - -(defmethod nav/preload-data! :create-account - [db] - (update db :accounts/create - #(-> % - (assoc :step :enter-password) - (dissoc :password :password-confirm :name :error)))) \ No newline at end of file diff --git a/src/status_im/ui/screens/hardwallet/authentication_method/views.cljs b/src/status_im/ui/screens/hardwallet/authentication_method/views.cljs index d947576d5e..ee29baac4c 100644 --- a/src/status_im/ui/screens/hardwallet/authentication_method/views.cljs +++ b/src/status_im/ui/screens/hardwallet/authentication_method/views.cljs @@ -39,4 +39,4 @@ :on-press #(re-frame/dispatch [:hardwallet.ui/status-hardwallet-option-pressed])}] [authentication-method-row {:title (i18n/label :t/password) :icon :icons/password - :on-press #(re-frame/dispatch [:navigate-to :create-account])}]]]]) \ No newline at end of file + :on-press #(re-frame/dispatch [:hardwallet.ui/password-option-pressed])}]]]]) diff --git a/src/status_im/ui/screens/intro/views.cljs b/src/status_im/ui/screens/intro/views.cljs index 2743d7f4c1..5b1606d945 100644 --- a/src/status_im/ui/screens/intro/views.cljs +++ b/src/status_im/ui/screens/intro/views.cljs @@ -20,7 +20,7 @@ :key :intro-text-description}]] [react/view styles/buttons-container [components.common/button {:button-style {:flex-direction :row} - :on-press #(re-frame/dispatch [:navigate-to :create-account]) + :on-press #(re-frame/dispatch [:accounts.create.ui/create-new-account-button-pressed]) :label (i18n/label :t/create-account)}] [react/view styles/bottom-button-container [components.common/button {:on-press #(re-frame/dispatch [:navigate-to :recover])