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

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 []
(when (= auth-method constants/auth-method-biometric)
(rf/dispatch [:biometric/authenticate (rf/dispatch [:biometric/authenticate
{:on-success #(rf/dispatch {:on-success #(rf/dispatch
[:profile.login/biometric-success]) [:profile.login/biometric-success])
:on-fail #(rf/dispatch :on-fail #(rf/dispatch
[:profile.login/biometric-auth-fail [: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]}]