Skip to content

Commit 5932f7d

Browse files
authored
Fix keycard login flow options while using empty keycard (#22182)
1 parent b89dce3 commit 5932f7d

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

src/status_im/contexts/keycard/error/view.cljs

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
(defn view
2424
[]
2525
(let [error (rf/sub [:keycard/application-info-error])
26+
logged-in? (rf/sub [:multiaccount/logged-in?])
2627
{:keys [title description]} (get titles error)]
2728
[:<>
2829
[quo/page-nav
@@ -37,21 +38,31 @@
3738
[quo/section-label
3839
{:section (i18n/label :t/what-you-can-do) :container-style {:padding-vertical 8}}]
3940
(if (= error :keycard/error.keycard-empty)
40-
[quo/settings-item
41-
{:title (i18n/label :t/use-backup-keycard)
42-
:image :icon
43-
:image-props :i/placeholder
44-
:action :arrow
45-
:description :text
46-
:description-props {:text (i18n/label :t/create-backup-profile-keycard)}
47-
:on-press (fn []
48-
(rf/dispatch [:show-bottom-sheet
49-
{:content
50-
(fn []
51-
[backup.view/sheet
52-
{:on-continue
53-
(rf/dispatch
54-
[:keycard/backup.create-or-enter-pin])}])}]))}]
41+
(if logged-in?
42+
[quo/settings-item
43+
{:title (i18n/label :t/use-backup-keycard)
44+
:image :icon
45+
:image-props :i/placeholder
46+
:action :arrow
47+
:description :text
48+
:description-props {:text (i18n/label :t/create-backup-profile-keycard)}
49+
:on-press (fn []
50+
(rf/dispatch [:show-bottom-sheet
51+
{:content
52+
(fn []
53+
[backup.view/sheet
54+
{:on-continue
55+
(rf/dispatch
56+
[:keycard/backup.create-or-enter-pin])}])}]))}]
57+
[quo/settings-item
58+
{:title (i18n/label :t/create-new-profile)
59+
:image :icon
60+
:image-props :i/profile
61+
:action :arrow
62+
:description :text
63+
:description-props {:text (i18n/label :t/new-key-pair-keycard)}
64+
:on-press (fn []
65+
(rf/dispatch [:keycard/create.get-phrase]))}])
5566
[:<>
5667
(when (or (= error :keycard/error.keycard-frozen)
5768
(= error :keycard/error.keycard-locked))

src/status_im/navigation/effects.cljs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@
164164
theme)})
165165
options
166166
(when sheet?
167-
options/sheet-options))}}]}})
168-
(state/navigation-state-push {:id component
169-
:type :modal})))))
167+
options/sheet-options))}}]}})))
168+
(state/navigation-state-push {:id component
169+
:type :modal})))
170170

171171
(rf/reg-fx :open-modal-fx open-modal)
172172

0 commit comments

Comments
 (0)