removes flow related flags when cancelling

Signed-off-by: Michele Balistreri <michele@bitgamma.com>
This commit is contained in:
Michele Balistreri 2021-05-07 13:35:28 +03:00
parent b71617e490
commit 427209c960
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
2 changed files with 15 additions and 4 deletions

View File

@ -29,6 +29,16 @@
[{:keys [db] :as cofx} checked?] [{:keys [db] :as cofx} checked?]
{:db (assoc-in db [:multiaccounts/key-storage :move-keystore-checked?] checked?)}) {:db (assoc-in db [:multiaccounts/key-storage :move-keystore-checked?] checked?)})
(fx/defn navigate-back
{:events [::navigate-back]}
[{:keys [db] :as cofx}]
(fx/merge
cofx
{:db (-> db
(dissoc :recovered-account?)
(update :keycard dissoc :from-key-storage-and-migration? :creating-backup?))}
(navigation/navigate-back)))
(fx/defn enter-seed-pressed (fx/defn enter-seed-pressed
"User is logged out and probably wants to move multiaccount to Keycard. Navigate to enter seed phrase screen" "User is logged out and probably wants to move multiaccount to Keycard. Navigate to enter seed phrase screen"
{:events [::enter-seed-pressed]} {:events [::enter-seed-pressed]}

View File

@ -18,9 +18,10 @@
[status-im.ui.screens.multiaccounts.key-storage.styles :as styles] [status-im.ui.screens.multiaccounts.key-storage.styles :as styles]
[status-im.utils.security])) [status-im.utils.security]))
(defn local-topbar [subtitle] (defn local-topbar [subtitle action]
[topbar/topbar {:title (i18n/label :t/key-managment) [topbar/topbar (merge {:title (i18n/label :t/key-managment)
:subtitle subtitle}]) :subtitle subtitle}
(when action {:navigation {:on-press #(re-frame/dispatch [action])}}))])
(defonce accordian-data (defonce accordian-data
[{:id :type [{:id :type
@ -106,7 +107,7 @@
[{:keys [seed-word-count seed-shape-invalid?]} [:multiaccounts/key-storage] [{:keys [seed-word-count seed-shape-invalid?]} [:multiaccounts/key-storage]
{:keys [creating-backup?]} [:keycard]] {:keys [creating-backup?]} [:keycard]]
[react/keyboard-avoiding-view {:flex 1} [react/keyboard-avoiding-view {:flex 1}
[local-topbar (i18n/label :t/enter-seed-phrase)] [local-topbar (i18n/label :t/enter-seed-phrase) ::multiaccounts.key-storage/navigate-back]
[multiaccounts.views/seed-phrase-input [multiaccounts.views/seed-phrase-input
{:on-change-event [::multiaccounts.key-storage/seed-phrase-input-changed] {:on-change-event [::multiaccounts.key-storage/seed-phrase-input-changed]
:seed-word-count seed-word-count :seed-word-count seed-word-count