mirror of
https://github.com/status-im/status-react.git
synced 2025-02-22 15:48:50 +00:00
Allow users to view the recovery phrase again when creating a profile for an empty keycard (#22009)
This commit is contained in:
parent
1a5008bcda
commit
4782b3eb2a
@ -20,6 +20,13 @@
|
||||
(rf/dispatch [:navigate-back])
|
||||
(rf/dispatch [:open-modal :screen/confirm-backup
|
||||
{:masked-seed-phrase masked-seed-phrase
|
||||
:on-try-again #(rf/dispatch [:open-modal :screen/backup-recovery-phrase-dark
|
||||
{:on-success backup-recovery-phrase-success
|
||||
:masked-seed-phrase (->> masked-seed-phrase
|
||||
security/safe-unmask-data
|
||||
(string/join " ")
|
||||
security/mask-data)
|
||||
:revealed? true}])
|
||||
:on-success #(rf/dispatch [:keycard/create.phrase-backed-up
|
||||
masked-seed-phrase])}]))
|
||||
|
||||
|
@ -57,6 +57,13 @@
|
||||
(rf/dispatch [:navigate-back])
|
||||
(rf/dispatch [:open-modal :screen/confirm-backup
|
||||
{:masked-seed-phrase masked-seed-phrase
|
||||
:on-try-again #(rf/dispatch [:open-modal :screen/backup-recovery-phrase-dark
|
||||
{:on-success backup-recovery-phrase-success
|
||||
:masked-seed-phrase (->> masked-seed-phrase
|
||||
security/safe-unmask-data
|
||||
(string/join " ")
|
||||
security/mask-data)
|
||||
:revealed? true}])
|
||||
:on-success #(rf/dispatch [:keycard/migration.phrase-backed-up])}]))
|
||||
|
||||
(rf/reg-event-fx :keycard/migration.get-phrase
|
||||
|
@ -44,22 +44,23 @@
|
||||
|
||||
(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])
|
||||
{:keys [on-success masked-seed-phrase]} (rf/sub [:get-screen-params])
|
||||
seed-phrase (reagent/atom (if masked-seed-phrase
|
||||
(->
|
||||
(security/safe-unmask-data
|
||||
masked-seed-phrase)
|
||||
(string/split #"\s"))
|
||||
[]))]
|
||||
(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})
|
||||
{:keys [on-success masked-seed-phrase
|
||||
revealed?]} (rf/sub [:get-screen-params])
|
||||
revealed? (reagent/atom revealed?)
|
||||
customization-color (rf/sub [:profile/customization-color])
|
||||
seed-phrase (reagent/atom (if masked-seed-phrase
|
||||
(->
|
||||
(security/safe-unmask-data
|
||||
masked-seed-phrase)
|
||||
(string/split #"\s"))
|
||||
[]))]
|
||||
(fn []
|
||||
(let [theme (quo.theme/use-theme)]
|
||||
(rn/use-mount
|
||||
@ -108,8 +109,7 @@
|
||||
[quo/bottom-actions
|
||||
{:actions :one-action
|
||||
:button-one-label (i18n/label :t/i-have-written)
|
||||
:button-one-props {:disabled? (some false? (vals @checked?))
|
||||
:customization-color customization-color
|
||||
:button-one-props {:customization-color customization-color
|
||||
:on-press #(on-success (security/mask-data @seed-phrase))}}]
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
|
@ -31,7 +31,7 @@
|
||||
[(subvec result 0 2) (subvec result 2 4)]))
|
||||
|
||||
(defn- cheat-warning
|
||||
[]
|
||||
[on-try-again]
|
||||
(let [customization-color (rf/sub [:profile/customization-color])]
|
||||
[:<>
|
||||
[quo/drawer-top {:title (i18n/label :t/do-not-cheat)}]
|
||||
@ -43,7 +43,9 @@
|
||||
:button-one-props {:customization-color customization-color
|
||||
:on-press (fn []
|
||||
(rf/dispatch [:hide-bottom-sheet])
|
||||
(rf/dispatch [:navigate-back]))}}]]))
|
||||
(rf/dispatch [:navigate-back])
|
||||
(when on-try-again
|
||||
(on-try-again)))}}]]))
|
||||
|
||||
(defn- button
|
||||
[{:keys [word margin-right on-press]}]
|
||||
@ -95,6 +97,7 @@
|
||||
incorrect-count (reagent/atom 0)
|
||||
show-error? (reagent/atom false)
|
||||
{:keys [on-success
|
||||
on-try-again
|
||||
masked-seed-phrase]} (rf/sub [:get-screen-params])
|
||||
unmasked-seed-phrase (security/safe-unmask-data masked-seed-phrase)
|
||||
random-phrase (reagent/atom [])]
|
||||
@ -121,7 +124,9 @@
|
||||
(do
|
||||
(when (> @incorrect-count 0)
|
||||
(rf/dispatch [:show-bottom-sheet
|
||||
{:content cheat-warning}]))
|
||||
{:content (fn []
|
||||
[cheat-warning
|
||||
on-try-again])}]))
|
||||
(reset! incorrect-count (inc @incorrect-count))
|
||||
(reset! show-error? true))))]
|
||||
[rn/view {:style {:flex 1}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user