fix: face id toggle respect system face id permission (#20227)
Signed-off-by: yqrashawn <namy.19@gmail.com>
This commit is contained in:
parent
799bd1d4dc
commit
874906b11f
|
@ -41,13 +41,13 @@
|
|||
[message]
|
||||
(let [cause (if platform/android?
|
||||
(condp = message
|
||||
android-not-enrolled-error-message :biometrics/not-enrolled-error
|
||||
android-not-enrolled-error-message :biometrics/fingerprints-not-enrolled-error
|
||||
android-not-available-error-message :biometrics/not-available-error
|
||||
android-too-many-attempts-error-message :biometric/too-many-attempts
|
||||
:biometrics/unknown-error)
|
||||
|
||||
(condp #(string/includes? %2 %1) message
|
||||
ios-not-enrolled-error-message :biometrics/not-enrolled-error
|
||||
ios-not-enrolled-error-message :biometrics/ios-not-enrolled-error
|
||||
:biometrics/unknown-error))]
|
||||
(ex-info "Failed to authenticate with biometrics"
|
||||
{:orig-error-message message}
|
||||
|
|
|
@ -14,8 +14,11 @@
|
|||
(defn show-message
|
||||
[_ [code]]
|
||||
(let [content (case code
|
||||
(:biometrics/not-enrolled-error
|
||||
(:biometrics/fingerprints-not-enrolled-error
|
||||
:biometrics/not-available-error)
|
||||
(i18n/label :t/grant-fingerprints-permissions)
|
||||
|
||||
:biometrics/ios-not-enrolled-error
|
||||
(i18n/label :t/grant-face-id-permissions)
|
||||
|
||||
:biometric/too-many-attempts
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
(let [cofx {:db {}}
|
||||
expected {:fx [[:effects.utils/show-popup
|
||||
{:title (i18n/label :t/biometric-auth-login-error-title)
|
||||
:content (i18n/label :t/grant-face-id-permissions)}]]}]
|
||||
:content (i18n/label :t/grant-fingerprints-permissions)}]]}]
|
||||
(is (match? expected
|
||||
(sut/show-message cofx
|
||||
[:biometrics/not-available-error])))))
|
||||
|
|
|
@ -30,18 +30,18 @@
|
|||
supported? (boolean biometric-type)
|
||||
enabled? (= auth-method constants/auth-method-biometric)
|
||||
biometric-on? (and supported? enabled?)
|
||||
press-handler (if biometric-on?
|
||||
press-handler (when supported?
|
||||
(if biometric-on?
|
||||
(fn [] (rf/dispatch [:biometric/disable]))
|
||||
(on-press-biometric-enable label theme))]
|
||||
(on-press-biometric-enable label theme)))]
|
||||
{:title label
|
||||
:image-props icon
|
||||
:image :icon
|
||||
:blur? true
|
||||
:action :selector
|
||||
:action-props {:disabled? (not supported?)
|
||||
:on-change press-handler
|
||||
:action-props {:on-change press-handler
|
||||
:checked? biometric-on?}
|
||||
:on-press (when supported? press-handler)}))
|
||||
:on-press press-handler}))
|
||||
|
||||
(defn- get-change-password-item
|
||||
[]
|
||||
|
|
|
@ -1629,6 +1629,7 @@
|
|||
"ok-save-pass": "OK, save password",
|
||||
"lock-app-with": "Lock app with",
|
||||
"grant-face-id-permissions": "To grant the required Face ID permission, please go to your system settings and make sure that Status > Face ID is selected",
|
||||
"grant-fingerprints-permissions": "To grant the required fingerprints permission, please go to your system settings and make sure that Status > Fingerprints is selected",
|
||||
"request-feature": "Request a feature",
|
||||
"select-account-dapp": "Select the account you wish to use with Dapps",
|
||||
"apply": "Apply",
|
||||
|
|
Loading…
Reference in New Issue