From 427209c960f0d323bf6f930eda33b6125b623fd0 Mon Sep 17 00:00:00 2001 From: Michele Balistreri Date: Fri, 7 May 2021 13:35:28 +0300 Subject: [PATCH] removes flow related flags when cancelling Signed-off-by: Michele Balistreri --- src/status_im/multiaccounts/key_storage/core.cljs | 10 ++++++++++ .../ui/screens/multiaccounts/key_storage/views.cljs | 9 +++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/status_im/multiaccounts/key_storage/core.cljs b/src/status_im/multiaccounts/key_storage/core.cljs index f424f83fb0..6eedc316aa 100644 --- a/src/status_im/multiaccounts/key_storage/core.cljs +++ b/src/status_im/multiaccounts/key_storage/core.cljs @@ -29,6 +29,16 @@ [{:keys [db] :as cofx} 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 "User is logged out and probably wants to move multiaccount to Keycard. Navigate to enter seed phrase screen" {:events [::enter-seed-pressed]} diff --git a/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs b/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs index 332717e60b..d8684c0256 100644 --- a/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs +++ b/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs @@ -18,9 +18,10 @@ [status-im.ui.screens.multiaccounts.key-storage.styles :as styles] [status-im.utils.security])) -(defn local-topbar [subtitle] - [topbar/topbar {:title (i18n/label :t/key-managment) - :subtitle subtitle}]) +(defn local-topbar [subtitle action] + [topbar/topbar (merge {:title (i18n/label :t/key-managment) + :subtitle subtitle} + (when action {:navigation {:on-press #(re-frame/dispatch [action])}}))]) (defonce accordian-data [{:id :type @@ -106,7 +107,7 @@ [{:keys [seed-word-count seed-shape-invalid?]} [:multiaccounts/key-storage] {:keys [creating-backup?]} [:keycard]] [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 {:on-change-event [::multiaccounts.key-storage/seed-phrase-input-changed] :seed-word-count seed-word-count