From 15a1a15c0841a43ece8d78ea35d768f729ab55b3 Mon Sep 17 00:00:00 2001 From: flexsurfer Date: Tue, 15 Oct 2024 16:48:47 +0200 Subject: [PATCH] Keycard - Allow user to migrate existing Profile [Part 2] (#21408) --- .../common/enter_seed_phrase/view.cljs | 51 +++++++++++-------- src/status_im/contexts/keycard/events.cljs | 31 ++++++----- .../contexts/keycard/sheets/migrate/view.cljs | 13 +++-- src/status_im/contexts/onboarding/events.cljs | 9 ---- .../backup_recovery_phrase/style.cljs | 2 +- .../backup_recovery_phrase/view.cljs | 37 +++++++------- .../contexts/profile/recover/effects.cljs | 24 ++++++++- .../contexts/profile/recover/events.cljs | 4 ++ .../contexts/profile/settings/view.cljs | 17 ++++--- .../contexts/settings/wallet/events.cljs | 2 +- .../contexts/settings/wallet/events_test.cljs | 2 +- .../add_account/create_account/events.cljs | 10 ---- .../create_account/select_keypair/view.cljs | 14 +++-- src/status_im/contexts/wallet/effects.cljs | 23 +-------- src/status_im/navigation/screens.cljs | 9 ++-- src/status_im/subs/profile.cljs | 6 +++ 16 files changed, 133 insertions(+), 121 deletions(-) rename src/status_im/contexts/{wallet/add_account/create_account/new_keypair => profile}/backup_recovery_phrase/style.cljs (93%) rename src/status_im/contexts/{wallet/add_account/create_account/new_keypair => profile}/backup_recovery_phrase/view.cljs (81%) diff --git a/src/status_im/common/enter_seed_phrase/view.cljs b/src/status_im/common/enter_seed_phrase/view.cljs index 20fb41424b..0de0ed64d2 100644 --- a/src/status_im/common/enter_seed_phrase/view.cljs +++ b/src/status_im/common/enter_seed_phrase/view.cljs @@ -96,7 +96,7 @@ (take 7))) (defn recovery-phrase-screen - [{:keys [banner-offset initial-insets keypair title recovering-keypair? render-controls]}] + [{:keys [banner-offset initial-insets keypair title on-success render-controls]}] (reagent/with-let [keyboard-shown? (reagent/atom false) keyboard-show-listener (.addListener rn/keyboard "keyboardDidShow" @@ -120,14 +120,20 @@ (reset! seed-phrase new-phrase)) on-submit (fn [] (swap! seed-phrase clean-seed-phrase) - (if recovering-keypair? - (rf/dispatch [:wallet/seed-phrase-entered - (security/mask-data - @seed-phrase) - set-invalid-seed-phrase]) - (rf/dispatch [:onboarding/seed-phrase-entered - (security/mask-data @seed-phrase) - set-invalid-seed-phrase])))] + (rf/dispatch + [:profile.recover/validate-recovery-phrase + (security/mask-data @seed-phrase) + {:on-success (fn [mnemonic key-uid] + (if on-success + (on-success + {:key-uid key-uid + :phrase mnemonic + :on-error + set-invalid-seed-phrase}) + (rf/dispatch + [:onboarding/seed-phrase-validated + mnemonic key-uid]))) + :on-error set-invalid-seed-phrase}]))] (let [words-coll (mnemonic/passphrase->words @seed-phrase) last-word (peek words-coll) pick-suggested-word (fn [pressed-word] @@ -191,7 +197,7 @@ [rn/view {:style style/keyboard-container} [quo/predictive-keyboard {:type suggestions-state - :blur? (not recovering-keypair?) + :blur? (not on-success) :text suggestions-text :words (keyboard-suggestions last-word) :on-press pick-suggested-word}]])]) @@ -200,7 +206,7 @@ (.remove keyboard-hide-listener)))) (defn screen - [{:keys [title keypair navigation-icon recovering-keypair? render-controls]}] + [{:keys [title keypair navigation-icon on-success render-controls]}] (let [[insets _] (rn/use-state (safe-area/get-insets)) banner-offset (rf/sub [:alert-banners/top-margin])] [rn/view {:style style/full-layout} @@ -209,21 +215,22 @@ {:margin-top (:top insets) :background :blur :icon-name (or navigation-icon - (if recovering-keypair? :i/close :i/arrow-left)) + (if on-success :i/close :i/arrow-left)) :on-press #(rf/dispatch [:navigate-back])}] [recovery-phrase-screen - {:title title - :keypair keypair - :render-controls render-controls - :banner-offset banner-offset - :initial-insets insets - :recovering-keypair? recovering-keypair?}]]])) + {:title title + :keypair keypair + :render-controls render-controls + :banner-offset banner-offset + :initial-insets insets + :on-success on-success}]]])) (defn view [] - (let [{:keys [recovering-keypair?]} (rf/sub [:get-screen-params])] + (let [{:keys [on-success]} (rf/sub [:get-screen-params])] (rn/use-unmount - #(rf/dispatch [:onboarding/clear-navigated-to-enter-seed-phrase-from-screen])) + (when-not on-success + #(rf/dispatch [:onboarding/clear-navigated-to-enter-seed-phrase-from-screen]))) [screen - {:title (i18n/label :t/use-recovery-phrase) - :recovering-keypair? recovering-keypair?}])) + {:title (i18n/label :t/use-recovery-phrase) + :on-success on-success}])) diff --git a/src/status_im/contexts/keycard/events.cljs b/src/status_im/contexts/keycard/events.cljs index 274b78390c..f6be5b6dc9 100644 --- a/src/status_im/contexts/keycard/events.cljs +++ b/src/status_im/contexts/keycard/events.cljs @@ -72,22 +72,21 @@ (rf/reg-event-fx :keycard/on-get-application-info-success (fn [{:keys [db]} [application-info {:keys [key-uid on-success-fx]}]] - (let [error (keycard.utils/validate-application-info key-uid application-info)] - (if error - (case error - :keycard/error.not-keycard - {:fx [[:dispatch [:keycard/disconnect]] - [:dispatch [:open-modal :screen/keycard.not-keycard]]]} - :keycard/error.keycard-blank - {:fx [[:dispatch [:keycard/disconnect]] - [:dispatch [:open-modal :screen/keycard.empty]]]} - {:db (assoc-in db [:keycard :application-info-error] error) - :fx [[:dispatch [:keycard/disconnect]] - [:dispatch [:open-modal :screen/keycard.error]]]}) - {:db (-> db - (assoc-in [:keycard :application-info] application-info) - (assoc-in [:keycard :pin :status] :verifying)) - :fx on-success-fx})))) + (if-let [error (keycard.utils/validate-application-info key-uid application-info)] + (case error + :keycard/error.not-keycard + {:fx [[:dispatch [:keycard/disconnect]] + [:dispatch [:open-modal :screen/keycard.not-keycard]]]} + :keycard/error.keycard-blank + {:fx [[:dispatch [:keycard/disconnect]] + [:dispatch [:open-modal :screen/keycard.empty]]]} + {:db (assoc-in db [:keycard :application-info-error] error) + :fx [[:dispatch [:keycard/disconnect]] + [:dispatch [:open-modal :screen/keycard.error]]]}) + {:db (-> db + (assoc-in [:keycard :application-info] application-info) + (assoc-in [:keycard :pin :status] :verifying)) + :fx on-success-fx}))) (rf/reg-event-fx :keycard/get-application-info (fn [_ [{:keys [on-success on-failure]}]] diff --git a/src/status_im/contexts/keycard/sheets/migrate/view.cljs b/src/status_im/contexts/keycard/sheets/migrate/view.cljs index 23b9e02a9a..60b038df3b 100644 --- a/src/status_im/contexts/keycard/sheets/migrate/view.cljs +++ b/src/status_im/contexts/keycard/sheets/migrate/view.cljs @@ -6,9 +6,10 @@ (defn view [] - (let [profile-name (rf/sub [:profile/name]) - profile-picture (rf/sub [:profile/image]) - customization-color (rf/sub [:profile/customization-color])] + (let [profile-name (rf/sub [:profile/name]) + profile-picture (rf/sub [:profile/image]) + customization-color (rf/sub [:profile/customization-color]) + recovery-phrase-backed-up? (rf/sub [:profile/recovery-phrase-backed-up?])] [:<> [quo/drawer-top {:type :context-tag @@ -27,7 +28,11 @@ [quo/bottom-actions {:actions :two-actions :button-one-label (i18n/label :t/continue) - :button-one-props {:on-press #()} + :button-one-props {:on-press #(if recovery-phrase-backed-up? + (rf/dispatch [:open-modal :screen/use-recovery-phrase + {:on-success (fn [])}]) + (rf/dispatch [:open-modal :screen/backup-recovery-phrase + {:on-success (fn [])}]))} :button-two-label (i18n/label :t/cancel) :button-two-props {:type :grey :on-press #(rf/dispatch [:hide-bottom-sheet])}}]])) diff --git a/src/status_im/contexts/onboarding/events.cljs b/src/status_im/contexts/onboarding/events.cljs index c3073b1cb4..a17f28b1f7 100644 --- a/src/status_im/contexts/onboarding/events.cljs +++ b/src/status_im/contexts/onboarding/events.cljs @@ -131,15 +131,6 @@ [:open-modal :screen/onboarding.enable-biometrics] [:open-modal :screen/onboarding.enable-notifications])})) -(rf/defn seed-phrase-entered - {:events [:onboarding/seed-phrase-entered]} - [_ seed-phrase on-error] - {:multiaccount/validate-mnemonic [seed-phrase - (fn [mnemonic key-uid] - (re-frame/dispatch [:onboarding/seed-phrase-validated - mnemonic key-uid])) - on-error]}) - (rf/defn seed-phrase-validated {:events [:onboarding/seed-phrase-validated]} [{:keys [db]} seed-phrase key-uid] diff --git a/src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/style.cljs b/src/status_im/contexts/profile/backup_recovery_phrase/style.cljs similarity index 93% rename from src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/style.cljs rename to src/status_im/contexts/profile/backup_recovery_phrase/style.cljs index e9db5c6116..321bc9f677 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/style.cljs +++ b/src/status_im/contexts/profile/backup_recovery_phrase/style.cljs @@ -1,4 +1,4 @@ -(ns status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.style +(ns status-im.contexts.profile.backup-recovery-phrase.style (:require [quo.foundations.colors :as colors] [react-native.platform :as platform])) diff --git a/src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/view.cljs b/src/status_im/contexts/profile/backup_recovery_phrase/view.cljs similarity index 81% rename from src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/view.cljs rename to src/status_im/contexts/profile/backup_recovery_phrase/view.cljs index fae6b9f16c..16bd6ca835 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/new_keypair/backup_recovery_phrase/view.cljs +++ b/src/status_im/contexts/profile/backup_recovery_phrase/view.cljs @@ -1,4 +1,4 @@ -(ns status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.view +(ns status-im.contexts.profile.backup-recovery-phrase.view (:require [clojure.string :as string] [native-module.core :as native-module] @@ -6,8 +6,7 @@ [quo.theme :as quo.theme] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.style :as - style] + [status-im.contexts.profile.backup-recovery-phrase.style :as style] [utils.i18n :as i18n] [utils.re-frame :as rf] [utils.security.core :as security])) @@ -45,20 +44,20 @@ (defn view [] - (let [step-labels [:t/backup-step-1 :t/backup-step-2 :t/backup-step-3 - :t/backup-step-4] - checked? (reagent/atom - {:0 false - :1 false - :2 false - :3 false}) - revealed? (reagent/atom false) - customization-color (rf/sub [:profile/customization-color]) - seed-phrase (reagent/atom []) - random-phrase (reagent/atom [])] + (let [step-labels [:t/backup-step-1 :t/backup-step-2 :t/backup-step-3 + :t/backup-step-4] + checked? (reagent/atom + {:0 false + :1 false + :2 false + :3 false}) + revealed? (reagent/atom false) + customization-color (rf/sub [:profile/customization-color]) + {:keys [on-success]} (rf/sub [:get-screen-params]) + seed-phrase (reagent/atom []) + random-phrase (reagent/atom [])] (fn [] (let [theme (quo.theme/use-theme)] - (rn/use-mount (fn [] (native-module/get-random-mnemonic #(reset! seed-phrase (string/split % #"\s"))) @@ -107,10 +106,10 @@ :button-one-label (i18n/label :t/i-have-written) :button-one-props {:disabled? (some false? (vals @checked?)) :customization-color customization-color - :on-press #(rf/dispatch [:wallet/store-new-seed-phrase - {:seed-phrase (security/mask-data - @seed-phrase) - :random-phrase @random-phrase}])}}] + :on-press #(on-success {:masked-seed-phrase + (security/mask-data + @seed-phrase) + :random-phrase @random-phrase})}}] [quo/text {:size :paragraph-2 :style (style/description-text theme)} diff --git a/src/status_im/contexts/profile/recover/effects.cljs b/src/status_im/contexts/profile/recover/effects.cljs index a57c8fd735..42b7858d75 100644 --- a/src/status_im/contexts/profile/recover/effects.cljs +++ b/src/status_im/contexts/profile/recover/effects.cljs @@ -1,9 +1,31 @@ (ns status-im.contexts.profile.recover.effects (:require [native-module.core :as native-module] - [utils.re-frame :as rf])) + [promesa.core :as promesa] + [utils.re-frame :as rf] + [utils.security.core :as security] + [utils.transforms :as transforms])) (rf/reg-fx :effects.profile/restore-and-login (fn [request] ;;"node.login" signal will be triggered as a callback (native-module/restore-account-and-login request))) + +(defn validate-mnemonic + [mnemonic] + (-> mnemonic + (security/safe-unmask-data) + (native-module/validate-mnemonic) + (promesa/then (fn [result] + (let [{:keys [keyUID]} (transforms/json->clj result)] + {:key-uid keyUID}))))) + +(rf/reg-fx :effects.profile/validate-recovery-phrase + (fn [[mnemonic on-success on-error]] + (-> (validate-mnemonic mnemonic) + (promesa/then (fn [{:keys [key-uid]}] + (when (fn? on-success) + (on-success mnemonic key-uid)))) + (promesa/catch (fn [error] + (when (and error (fn? on-error)) + (on-error error))))))) diff --git a/src/status_im/contexts/profile/recover/events.cljs b/src/status_im/contexts/profile/recover/events.cljs index 381ad83af9..5f3f50c198 100644 --- a/src/status_im/contexts/profile/recover/events.cljs +++ b/src/status_im/contexts/profile/recover/events.cljs @@ -24,3 +24,7 @@ :imagePath (profile.config/strip-file-prefix image-path) :customizationColor (or color constants/profile-default-color) :fetchBackup true)})) + +(rf/reg-event-fx :profile.recover/validate-recovery-phrase + (fn [_ [phrase {:keys [on-success on-error]}]] + {:effects.profile/validate-recovery-phrase [phrase on-success on-error]})) diff --git a/src/status_im/contexts/profile/settings/view.cljs b/src/status_im/contexts/profile/settings/view.cljs index bbef55bfd8..5d33a15f33 100644 --- a/src/status_im/contexts/profile/settings/view.cljs +++ b/src/status_im/contexts/profile/settings/view.cljs @@ -49,13 +49,14 @@ (defn view [] - (let [theme (quo.theme/use-theme) - insets (safe-area/get-insets) - customization-color (rf/sub [:profile/customization-color]) - scroll-y (reanimated/use-shared-value 0) - profile (rf/sub [:profile/profile]) - full-name (profile.utils/displayed-name profile) - on-scroll (rn/use-callback #(scroll-handler % scroll-y))] + (let [theme (quo.theme/use-theme) + insets (safe-area/get-insets) + customization-color (rf/sub [:profile/customization-color]) + scroll-y (reanimated/use-shared-value 0) + profile (rf/sub [:profile/profile]) + recovery-phrase-backed-up? (rf/sub [:profile/recovery-phrase-backed-up?]) + full-name (profile.utils/displayed-name profile) + on-scroll (rn/use-callback #(scroll-handler % scroll-y))] [quo/overlay {:type :shell} [rn/view {:style (style/navigation-wrapper {:customization-color customization-color @@ -79,7 +80,7 @@ profile)}}])}]}]] [rn/flat-list {:header [settings.header/view {:scroll-y scroll-y}] - :data (settings.items/items (boolean (seq (:mnemonic profile)))) + :data (settings.items/items (not recovery-phrase-backed-up?)) :shows-vertical-scroll-indicator false :render-fn settings-category-view :get-item-layout get-item-layout diff --git a/src/status_im/contexts/settings/wallet/events.cljs b/src/status_im/contexts/settings/wallet/events.cljs index d762d76db9..a1b8ae3d32 100644 --- a/src/status_im/contexts/settings/wallet/events.cljs +++ b/src/status_im/contexts/settings/wallet/events.cljs @@ -160,7 +160,7 @@ (defn wallet-validate-seed-phrase [_ [seed-phrase on-success on-error]] - {:fx [[:multiaccount/validate-mnemonic [seed-phrase on-success on-error]]]}) + {:fx [[:effects.profile/validate-recovery-phrase [seed-phrase on-success on-error]]]}) (rf/reg-event-fx :wallet/validate-seed-phrase wallet-validate-seed-phrase) diff --git a/src/status_im/contexts/settings/wallet/events_test.cljs b/src/status_im/contexts/settings/wallet/events_test.cljs index 7c7f5f27ad..0858a23652 100644 --- a/src/status_im/contexts/settings/wallet/events_test.cljs +++ b/src/status_im/contexts/settings/wallet/events_test.cljs @@ -101,7 +101,7 @@ seed-phrase-masked (security/mask-data "seed phrase") on-success #(prn "success") on-error #(prn "error") - expected {:fx [[:multiaccount/validate-mnemonic + expected {:fx [[:effects.profile/validate-recovery-phrase [seed-phrase-masked on-success on-error]]]}] (is (= expected (sut/wallet-validate-seed-phrase diff --git a/src/status_im/contexts/wallet/add_account/create_account/events.cljs b/src/status_im/contexts/wallet/add_account/create_account/events.cljs index 2c32ec04d6..1695e49f56 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/events.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/events.cljs @@ -61,16 +61,6 @@ (rf/reg-event-fx :wallet/seed-phrase-validated seed-phrase-validated) -(defn seed-phrase-entered - [_ [seed-phrase on-error]] - {:fx [[:multiaccount/validate-mnemonic - [seed-phrase - (fn [mnemonic key-uid] - (rf/dispatch [:wallet/seed-phrase-validated mnemonic key-uid on-error])) - on-error]]]}) - -(rf/reg-event-fx :wallet/seed-phrase-entered seed-phrase-entered) - (defn store-account-generated-with-mnemonic [{:keys [db]} [{:keys [new-account-data keypair-name]}]] (let [new-account (update new-account-data :mnemonic security/mask-data)] diff --git a/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs index 5fbe2cb140..eb598d6d89 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs @@ -16,13 +16,21 @@ [[{:icon :i/add :accessibility-label :generate-new-keypair :label (i18n/label :t/generate-new-keypair) - :on-press #(rf/dispatch [:navigate-to :screen/wallet.backup-recovery-phrase])} + :on-press #(rf/dispatch [:navigate-to :screen/backup-recovery-phrase + {:on-success (fn [{:keys [masked-seed-phrase random-phrase]}] + (rf/dispatch [:wallet/store-new-seed-phrase + {:seed-phrase masked-seed-phrase + :random-phrase + random-phrase}]))}])} {:icon :i/seed :accessibility-label :import-using-phrase :label (i18n/label :t/import-using-phrase) :add-divider? true - :on-press #(rf/dispatch [:navigate-to :screen/wallet.enter-seed-phrase - {:recovering-keypair? true}])} + :on-press (fn [] + (rf/dispatch [:navigate-to :screen/use-recovery-phrase + {:on-success (fn [{:keys [key-uid phrase on-error]}] + (rf/dispatch [:wallet/seed-phrase-validated + phrase key-uid on-error]))}]))} (when (ff/enabled? ::ff/wallet.import-private-key) {:icon :i/key :accessibility-label :import-private-key diff --git a/src/status_im/contexts/wallet/effects.cljs b/src/status_im/contexts/wallet/effects.cljs index c300b665a5..0ec20e23e6 100644 --- a/src/status_im/contexts/wallet/effects.cljs +++ b/src/status_im/contexts/wallet/effects.cljs @@ -4,6 +4,7 @@ [native-module.core :as native-module] [promesa.core :as promesa] [status-im.common.json-rpc.events :as json-rpc] + [status-im.contexts.profile.recover.effects :as profile.recover.effects] [taoensso.timbre :as log] [utils.re-frame :as rf] [utils.security.core :as security] @@ -26,26 +27,6 @@ :paths paths} on-success)))) -(defn validate-mnemonic - [mnemonic] - (-> mnemonic - (security/safe-unmask-data) - (native-module/validate-mnemonic) - (promesa/then (fn [result] - (let [{:keys [keyUID]} (transforms/json->clj result)] - {:key-uid keyUID}))))) - -(rf/reg-fx - :multiaccount/validate-mnemonic - (fn [[mnemonic on-success on-error]] - (-> (validate-mnemonic mnemonic) - (promesa/then (fn [{:keys [key-uid]}] - (when (fn? on-success) - (on-success mnemonic key-uid)))) - (promesa/catch (fn [error] - (when (and error (fn? on-error)) - (on-error error))))))) - (defn create-account-from-private-key [private-key] (-> private-key @@ -81,7 +62,7 @@ (defn import-missing-keypair-by-seed-phrase [keypair-key-uid seed-phrase password] - (-> (validate-mnemonic seed-phrase) + (-> (profile.recover.effects/validate-mnemonic seed-phrase) (promesa/then (fn [{:keys [key-uid]}] (if (not= keypair-key-uid key-uid) diff --git a/src/status_im/navigation/screens.cljs b/src/status_im/navigation/screens.cljs index 9f7b24a47a..a993fabde1 100644 --- a/src/status_im/navigation/screens.cljs +++ b/src/status_im/navigation/screens.cljs @@ -47,6 +47,7 @@ [status-im.contexts.preview.quo.component-preview.view :as component-preview] [status-im.contexts.preview.quo.main :as quo.preview] [status-im.contexts.preview.status-im.main :as status-im-preview] + [status-im.contexts.profile.backup-recovery-phrase.view :as backup-recovery-phrase] [status-im.contexts.profile.contact.share.view :as share-contact] [status-im.contexts.profile.contact.view :as contact-profile] [status-im.contexts.profile.edit.accent-colour.view :as edit-accent-colour] @@ -107,8 +108,6 @@ wallet-import-private-key] [status-im.contexts.wallet.add-account.create-account.key-pair-name.view :as wallet-key-pair-name] - [status-im.contexts.wallet.add-account.create-account.new-keypair.backup-recovery-phrase.view :as - wallet-backup-recovery-phrase] [status-im.contexts.wallet.add-account.create-account.new-keypair.confirm-backup.view :as wallet-confirm-backup] [status-im.contexts.wallet.add-account.create-account.select-keypair.view :as wallet-select-keypair] @@ -476,9 +475,9 @@ :options {:insets {:top? true}} :component wallet-create-account/view} - {:name :screen/wallet.backup-recovery-phrase + {:name :screen/backup-recovery-phrase :options {:insets {:top? true :bottom? true}} - :component wallet-backup-recovery-phrase/view} + :component backup-recovery-phrase/view} {:name :screen/wallet.confirm-backup :options {:insets {:top? true :bottom? true}} @@ -488,7 +487,7 @@ :options {:insets {:top? true}} :component wallet-key-pair-name/view} - {:name :screen/wallet.enter-seed-phrase + {:name :screen/use-recovery-phrase :component enter-seed-phrase/view} {:name :screen/wallet.share-address diff --git a/src/status_im/subs/profile.cljs b/src/status_im/subs/profile.cljs index ef1be091f9..b2f5443bf8 100644 --- a/src/status_im/subs/profile.cljs +++ b/src/status_im/subs/profile.cljs @@ -345,6 +345,12 @@ (fn [{:keys [processing]}] processing)) +(re-frame/reg-sub + :profile/recovery-phrase-backed-up? + :<- [:profile/profile] + (fn [profile] + (not (boolean (seq (:mnemonic profile)))))) + ;; LINK PREVIEW ;; ========================================================================================================