Skip to content

Commit

Permalink
ref: moved biometrics constants to main constants file
Browse files Browse the repository at this point in the history
  • Loading branch information
clauxx committed Dec 11, 2023
1 parent e294870 commit 5a13b7c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
6 changes: 0 additions & 6 deletions src/status_im2/common/biometric/constants.cljs

This file was deleted.

10 changes: 5 additions & 5 deletions src/status_im2/common/biometric/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
[react-native.async-storage :as async-storage]
[react-native.platform :as platform]
[react-native.touch-id :as touch-id]
[status-im2.common.biometric.constants :as biometric-constants]
[status-im2.common.keychain.events :as keychain]
[status-im2.constants :as constants]
[taoensso.timbre :as log]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
Expand Down Expand Up @@ -47,11 +47,11 @@
{:events [:biometric/show-message]}
[_ code]
(let [handle-error? (and code
(not (contains? #{biometric-constants/auth-error-user-canceled
biometric-constants/auth-error-user-fallback}
(not (contains? #{constants/biometric-error-user-canceled
constants/biometric-error-user-fallback}
code)))
content (if (#{biometric-constants/auth-error-not-available
biometric-constants/auth-error-not-enrolled}
content (if (#{constants/biometric-error-not-available
constants/biometric-error-not-enrolled}
code)
(i18n/label :t/grant-face-id-permissions)
(i18n/label :t/biometric-auth-error {:code code}))]
Expand Down
5 changes: 5 additions & 0 deletions src/status_im2/constants.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@
(def ^:const auth-method-biometric-prepare "biometric-prepare")
(def ^:const auth-method-none "none")

(def ^:const biometric-error-user-canceled "USER_CANCELED")
(def ^:const biometric-error-user-fallback "USER_USER_FALLBACK")
(def ^:const biometric-error-not-available "NOT_AVAILABLE")
(def ^:const biometric-error-not-enrolled "NOT_ENROLLED")

(def ^:const onboarding-generating-keys-animation-duration-ms 7000)
(def ^:const onboarding-generating-keys-navigation-retry-ms 3000)

Expand Down
4 changes: 2 additions & 2 deletions src/status_im2/contexts/profile/login/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
[status-im.mobile-sync-settings.core :as mobile-network]
[status-im.pairing.core :as pairing]
[status-im.stickers.core :as stickers]
[status-im2.common.biometric.constants :as biometric-constants]
[status-im2.common.keychain.events :as keychain]
[status-im2.common.log :as logging]
[status-im2.common.universal-links :as universal-links]
[status-im2.config :as config]
[status-im2.constants :as constants]
[status-im2.contexts.chat.messages.link-preview.events :as link-preview]
[status-im2.contexts.contacts.events :as contacts]
[status-im2.contexts.profile.config :as profile.config]
Expand Down Expand Up @@ -219,7 +219,7 @@
(fn [{:keys [db]} [code]]
(let [key-uid (get-in db [:profile/login :key-uid])]
{:db db
:fx [(if (= code biometric-constants/auth-error-not-enrolled)
:fx [(if (= code constants/biometric-error-not-enrolled)
[:biometric/supress-not-enrolled-error
[key-uid
[:biometric/show-message code]]]
Expand Down

0 comments on commit 5a13b7c

Please sign in to comment.