fix: remove biometric button in the login screen when disabled biometrics (#19112)

This commit is contained in:
codemaster 2024-03-13 06:13:20 -07:00 committed by GitHub
parent e002fab376
commit 296d868797
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 11 deletions

View File

@ -170,20 +170,18 @@
(defn password-input
[]
(let [auth-method (rf/sub [:auth-method])
on-press-biometrics (rn/use-callback
(fn []
(when (= auth-method constants/auth-method-biometric)
(rf/dispatch [:biometric/authenticate
{:on-success #(rf/dispatch
[:profile.login/biometric-success])
:on-fail #(rf/dispatch
[:profile.login/biometric-auth-fail
%])}])))
[auth-method])]
on-press-biometrics (fn []
(rf/dispatch [:biometric/authenticate
{:on-success #(rf/dispatch
[:profile.login/biometric-success])
:on-fail #(rf/dispatch
[:profile.login/biometric-auth-fail
%])}]))
]
[standard-authentication/password-input
{:shell? true
:blur? true
:on-press-biometrics on-press-biometrics}]))
:on-press-biometrics (when (= auth-method constants/auth-method-biometric) on-press-biometrics)}]))
(defn login-section
[{:keys [show-profiles]}]