mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 02:04:28 +00:00
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
|
(re-frame/reg-fx
|
||||||
:get-supported-biometric-auth
|
:get-supported-biometric-auth
|
||||||
(fn []
|
(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
|
(fx/defn set-supported-biometric-auth
|
||||||
{:events [:init.callback/get-supported-biometric-auth-success]}
|
{:events [:init.callback/get-supported-biometric-auth-success]}
|
||||||
|
@ -29,18 +29,18 @@
|
|||||||
(when mnemonic
|
(when mnemonic
|
||||||
[[components.common/counter {:size 22} 1]
|
[[components.common/counter {:size 22} 1]
|
||||||
:chevron])}
|
:chevron])}
|
||||||
|
(when supported-biometric-auth
|
||||||
{:type :small
|
{:type :small
|
||||||
:title (str (i18n/label :t/lock-app-with) " " (biometric/get-label supported-biometric-auth))
|
:title (str (i18n/label :t/lock-app-with) " " (biometric/get-label supported-biometric-auth))
|
||||||
:container-margin-bottom 8
|
:container-margin-bottom 8
|
||||||
:accessibility-label :biometric-auth-settings-switch
|
:accessibility-label :biometric-auth-settings-switch
|
||||||
:disabled? (not (some? supported-biometric-auth))
|
|
||||||
:accessories [[react/switch
|
:accessories [[react/switch
|
||||||
{:track-color #js {:true colors/blue :false nil}
|
{:track-color #js {:true colors/blue :false nil}
|
||||||
:value (boolean biometric-auth?)
|
:value (boolean biometric-auth?)
|
||||||
:on-value-change #(re-frame/dispatch [:multiaccounts.ui/biometric-auth-switched %])
|
:on-value-change #(re-frame/dispatch [:multiaccounts.ui/biometric-auth-switched %])
|
||||||
:disabled (not supported-biometric-auth)}]]
|
:disabled (not supported-biometric-auth)}]]
|
||||||
:on-press #(re-frame/dispatch [:multiaccounts.ui/biometric-auth-switched
|
:on-press #(re-frame/dispatch [:multiaccounts.ui/biometric-auth-switched
|
||||||
((complement boolean) biometric-auth?)])}
|
((complement boolean) biometric-auth?)])})
|
||||||
;; TODO - uncomment when implemented
|
;; TODO - uncomment when implemented
|
||||||
;; {:type :small
|
;; {:type :small
|
||||||
;; :title :t/change-password
|
;; :title :t/change-password
|
||||||
|
Loading…
x
Reference in New Issue
Block a user