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 (defn password-input
[] []
(let [auth-method (rf/sub [:auth-method]) (let [auth-method (rf/sub [:auth-method])
on-press-biometrics (rn/use-callback on-press-biometrics (fn []
(fn [] (rf/dispatch [:biometric/authenticate
(when (= auth-method constants/auth-method-biometric) {:on-success #(rf/dispatch
(rf/dispatch [:biometric/authenticate [:profile.login/biometric-success])
{:on-success #(rf/dispatch :on-fail #(rf/dispatch
[:profile.login/biometric-success]) [:profile.login/biometric-auth-fail
:on-fail #(rf/dispatch %])}]))
[:profile.login/biometric-auth-fail ]
%])}])))
[auth-method])]
[standard-authentication/password-input [standard-authentication/password-input
{:shell? true {:shell? true
:blur? 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 (defn login-section
[{:keys [show-profiles]}] [{:keys [show-profiles]}]