disable biometric auth when device can't save password (rooted)
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
fc1bc48fdc
commit
49fd306f25
|
@ -101,7 +101,13 @@
|
|||
(re-frame/reg-fx
|
||||
:get-supported-biometric-auth
|
||||
(fn []
|
||||
(get-supported #(re-frame/dispatch [:init.callback/get-supported-biometric-auth-success %]))))
|
||||
(let [callback #(re-frame/dispatch [:init.callback/get-supported-biometric-auth-success %])]
|
||||
;;NOTE: if we can't save user password, we can't support biometrics
|
||||
(keychain/can-save-user-password?
|
||||
(fn [can-save?]
|
||||
(if can-save?
|
||||
(get-supported callback)
|
||||
(callback nil)))))))
|
||||
|
||||
(fx/defn set-supported-biometric-auth
|
||||
{:events [:init.callback/get-supported-biometric-auth-success]}
|
||||
|
|
|
@ -29,18 +29,18 @@
|
|||
(when mnemonic
|
||||
[[components.common/counter {:size 22} 1]
|
||||
:chevron])}
|
||||
{:type :small
|
||||
:title (str (i18n/label :t/lock-app-with) " " (biometric/get-label supported-biometric-auth))
|
||||
:container-margin-bottom 8
|
||||
:accessibility-label :biometric-auth-settings-switch
|
||||
:disabled? (not (some? supported-biometric-auth))
|
||||
:accessories [[react/switch
|
||||
{:track-color #js {:true colors/blue :false nil}
|
||||
:value (boolean biometric-auth?)
|
||||
:on-value-change #(re-frame/dispatch [:multiaccounts.ui/biometric-auth-switched %])
|
||||
:disabled (not supported-biometric-auth)}]]
|
||||
:on-press #(re-frame/dispatch [:multiaccounts.ui/biometric-auth-switched
|
||||
((complement boolean) biometric-auth?)])}
|
||||
(when supported-biometric-auth
|
||||
{:type :small
|
||||
:title (str (i18n/label :t/lock-app-with) " " (biometric/get-label supported-biometric-auth))
|
||||
:container-margin-bottom 8
|
||||
:accessibility-label :biometric-auth-settings-switch
|
||||
:accessories [[react/switch
|
||||
{:track-color #js {:true colors/blue :false nil}
|
||||
:value (boolean biometric-auth?)
|
||||
:on-value-change #(re-frame/dispatch [:multiaccounts.ui/biometric-auth-switched %])
|
||||
:disabled (not supported-biometric-auth)}]]
|
||||
:on-press #(re-frame/dispatch [:multiaccounts.ui/biometric-auth-switched
|
||||
((complement boolean) biometric-auth?)])})
|
||||
;; TODO - uncomment when implemented
|
||||
;; {:type :small
|
||||
;; :title :t/change-password
|
||||
|
|
Loading…
Reference in New Issue