Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c33530acab | ||
|
|
14d83fddff | ||
|
|
d9973c8d0b |
Binary file not shown.
|
After Width: | Height: | Size: 182 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 324 KiB |
@@ -29,6 +29,7 @@
|
||||
:keycard-migration (js/require "../resources/images/ui2/keycard-migration.png")
|
||||
:keycard-migration-failed (js/require "../resources/images/ui2/keycard-migration-failed.png")
|
||||
:keycard-migration-succeeded (js/require "../resources/images/ui2/keycard-migration-succeeded.png")
|
||||
:keycard-not-same (js/require "../resources/images/ui2/keycard-not-same.png")
|
||||
:not-keycard (js/require "../resources/images/ui2/not-keycard.png")
|
||||
:discover (js/require "../resources/images/ui2/discover.png")
|
||||
:invite-friends (js/require "../resources/images/ui2/invite-friends.png")
|
||||
|
||||
@@ -23,4 +23,7 @@
|
||||
(do
|
||||
(rf/dispatch [:keycard/disconnect])
|
||||
(rf/dispatch [:open-modal :screen/keycard.empty]))
|
||||
(rf/dispatch [:keycard/on-application-info-error error])))}]]]})))
|
||||
(rf/dispatch [:keycard/on-application-info-error
|
||||
(if (= error :keycard/error.keycard-wrong-profile)
|
||||
:keycard/error.keycard-not-empty
|
||||
error)])))}]]]})))
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
(fn [{:keys [db]} [error]]
|
||||
(if (or (= error :keycard/error.keycard-empty)
|
||||
(and (get-in db [:keycard :application-info :initialized?])
|
||||
(= error :keycard/error.keycard-wrong-profile)))
|
||||
(= error :keycard/error.keycard-not-empty)))
|
||||
(rf/dispatch [:keycard/create.continue])
|
||||
(rf/dispatch [:keycard/on-application-info-error error]))))
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
(:require [quo.core :as quo]
|
||||
[react-native.core :as rn]
|
||||
[status-im.common.events-helper :as events-helper]
|
||||
[status-im.common.resources :as resources]
|
||||
[utils.i18n :as i18n]))
|
||||
|
||||
(defn view
|
||||
@@ -14,7 +15,10 @@
|
||||
{:title (i18n/label :t/different-keycard)
|
||||
:description :text
|
||||
:description-text (i18n/label :t/scan-previous-keycard)}]
|
||||
[rn/view {:style {:flex 1}}]
|
||||
[rn/image
|
||||
{:resize-mode :contain
|
||||
:style {:flex 1 :width (:width (rn/get-window))}
|
||||
:source (resources/get-image :keycard-not-same)}]
|
||||
[rn/view {:style {:padding-horizontal 20}}
|
||||
[quo/button {:on-press events-helper/navigate-back}
|
||||
(i18n/label :t/try-again)]]])
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(def titles
|
||||
{:keycard/error.keycard-empty {:title (i18n/label :t/keycard-empty)
|
||||
:description (i18n/label :t/no-key-pair-keycard)}
|
||||
:keycard/error.keycard-wrong-profile {:title (i18n/label :t/keycard-not-empty)
|
||||
:description (i18n/label :t/cant-store-new-keys)}
|
||||
:keycard/error.keycard-unpaired {:title (i18n/label :t/keycard-full)
|
||||
:description (i18n/label :t/pairing-slots-occupied)}
|
||||
:keycard/error.keycard-frozen {:title (i18n/label :t/keycard-blocked)
|
||||
:description (i18n/label :t/cant-use-right-now)}
|
||||
:keycard/error.keycard-locked {:title (i18n/label :t/keycard-blocked)
|
||||
:description (i18n/label :t/cant-use-right-now)}})
|
||||
{:keycard/error.keycard-empty {:title (i18n/label :t/keycard-empty)
|
||||
:description (i18n/label :t/no-key-pair-keycard)}
|
||||
:keycard/error.keycard-not-empty {:title (i18n/label :t/keycard-not-empty)
|
||||
:description (i18n/label :t/cant-store-new-keys)}
|
||||
:keycard/error.keycard-unpaired {:title (i18n/label :t/keycard-full)
|
||||
:description (i18n/label :t/pairing-slots-occupied)}
|
||||
:keycard/error.keycard-frozen {:title (i18n/label :t/keycard-blocked)
|
||||
:description (i18n/label :t/cant-use-right-now)}
|
||||
:keycard/error.keycard-locked {:title (i18n/label :t/keycard-blocked)
|
||||
:description (i18n/label :t/cant-use-right-now)}})
|
||||
|
||||
(defn view
|
||||
[]
|
||||
|
||||
@@ -132,8 +132,9 @@
|
||||
:fx [[:dispatch [:keycard/disconnect]]
|
||||
[:dispatch
|
||||
[:open-modal
|
||||
(if (= :keycard/error.not-keycard error)
|
||||
:screen/keycard.not-keycard
|
||||
(case error
|
||||
:keycard/error.not-keycard :screen/keycard.not-keycard
|
||||
:keycard/error.keycard-wrong-profile :screen/keycard.different-card
|
||||
:screen/keycard.error)]]]}))
|
||||
|
||||
(rf/reg-event-fx :keycard/update-application-info
|
||||
|
||||
@@ -32,11 +32,7 @@
|
||||
(reset-card)
|
||||
(do
|
||||
(rf/dispatch [:navigate-back])
|
||||
(if (= error :keycard/error.keycard-wrong-profile)
|
||||
(do
|
||||
(rf/dispatch [:keycard/disconnect])
|
||||
(rf/dispatch [:open-modal :screen/keycard.different-card]))
|
||||
(rf/dispatch [:keycard/on-application-info-error error])))))}]))
|
||||
(rf/dispatch [:keycard/on-application-info-error error]))))}]))
|
||||
|
||||
(defn success-view
|
||||
[]
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
{:theme :dark
|
||||
:on-error
|
||||
(fn [error]
|
||||
(if (= error :keycard/error.keycard-wrong-profile)
|
||||
(if (= error :keycard/error.keycard-not-empty)
|
||||
(do
|
||||
(rf/dispatch [:keycard/disconnect])
|
||||
(rf/dispatch [:open-modal :screen/keycard.pin.enter
|
||||
|
||||
@@ -80,8 +80,4 @@
|
||||
:else
|
||||
(do
|
||||
(rf/dispatch [:navigate-back])
|
||||
(if (= error :keycard/error.keycard-wrong-profile)
|
||||
(do
|
||||
(rf/dispatch [:keycard/disconnect])
|
||||
(rf/dispatch [:open-modal :screen/keycard.different-card]))
|
||||
(rf/dispatch [:keycard/on-application-info-error error])))))}]]]}))
|
||||
(rf/dispatch [:keycard/on-application-info-error error]))))}]]]}))
|
||||
|
||||
@@ -30,6 +30,13 @@
|
||||
(not has-master-key?)
|
||||
:keycard/error.keycard-empty
|
||||
|
||||
(and (nil? profile-key-uid)
|
||||
(some? key-uid))
|
||||
:keycard/error.keycard-not-empty
|
||||
|
||||
(not= profile-key-uid key-uid)
|
||||
:keycard/error.keycard-wrong-profile
|
||||
|
||||
(and (zero? pin-retry-counter)
|
||||
(or (nil? puk-retry-counter)
|
||||
(pos? puk-retry-counter)))
|
||||
@@ -41,9 +48,6 @@
|
||||
(not paired?)
|
||||
:keycard/error.keycard-unpaired
|
||||
|
||||
(not= profile-key-uid key-uid)
|
||||
:keycard/error.keycard-wrong-profile
|
||||
|
||||
:else
|
||||
nil))
|
||||
|
||||
|
||||
@@ -256,6 +256,12 @@
|
||||
(rf/dispatch
|
||||
[:keycard/connect
|
||||
{:key-uid key-uid
|
||||
:on-error
|
||||
(fn [error]
|
||||
(rf/dispatch [:keycard/on-application-info-error
|
||||
(if (= error :keycard/error.keycard-empty)
|
||||
:keycard/error.keycard-wrong-profile
|
||||
error)]))
|
||||
:on-success
|
||||
(fn []
|
||||
(rf/dispatch
|
||||
|
||||
@@ -796,7 +796,7 @@
|
||||
"device-syncing": "Device syncing",
|
||||
"devices": "Devices",
|
||||
"devices-count": "{{number}} devices",
|
||||
"different-keycard": "It’s a different Keycard",
|
||||
"different-keycard": "This is a different Keycard",
|
||||
"disable": "disable",
|
||||
"disable-all": "Disable all",
|
||||
"disable-later-in-settings": "You can disable this later in Settings",
|
||||
|
||||
Reference in New Issue
Block a user