fix_: slider reset in standard authentication (#21831)

This commit fixes the slider-button doesn't reset after the completion of slider in standard authentication with keycard keypairs.

Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com>
This commit is contained in:
Mohamed Javid 2024-12-17 17:46:16 +05:30 committed by GitHub
parent c19128e8b1
commit 0f036ca9c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 4 deletions

View File

@ -15,8 +15,7 @@
auth-method (rf/sub [:auth-method]) auth-method (rf/sub [:auth-method])
biometric-auth? (= auth-method constants/auth-method-biometric) biometric-auth? (= auth-method constants/auth-method-biometric)
on-complete-callback (rn/use-callback on-complete-callback (rn/use-callback
(fn [reset-slider-fn] (fn []
(js/setTimeout #(reset-slider-fn false) 500)
(rf/dispatch [:standard-auth/authorize (rf/dispatch [:standard-auth/authorize
{:auth-button-icon-left auth-button-icon-left {:auth-button-icon-left auth-button-icon-left
:theme theme :theme theme
@ -26,13 +25,19 @@
:on-auth-fail on-auth-fail :on-auth-fail on-auth-fail
:auth-button-label auth-button-label}])) :auth-button-label auth-button-label}]))
(vec (conj dependencies on-auth-success on-auth-fail))) (vec (conj dependencies on-auth-success on-auth-fail)))
on-complete (or on-complete on-complete-callback) on-slider-complete (rn/use-callback
(fn [reset-slider-fn]
(js/setTimeout #(reset-slider-fn false) 500)
(if (fn? on-complete)
(on-complete)
(on-complete-callback)))
[on-complete on-complete-callback])
biometric-type (rf/sub [:biometrics/supported-type])] biometric-type (rf/sub [:biometrics/supported-type])]
[quo/slide-button [quo/slide-button
{:container-style container-style {:container-style container-style
:size size :size size
:customization-color customization-color :customization-color customization-color
:on-complete on-complete :on-complete on-slider-complete
:track-icon (if biometric-auth? :track-icon (if biometric-auth?
(biometric/get-icon-by-type biometric-type) (biometric/get-icon-by-type biometric-type)
:password) :password)