diff options
author | Allan Wang <me@allanwang.ca> | 2021-04-18 18:30:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-18 18:30:03 -0700 |
commit | bf55dbf9b46cd8826987ee6e556307e24f3d46cc (patch) | |
tree | aaca512641e6e4503859c4cb97a29a9296669f9d /app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt | |
parent | 88a5d17814ff9f7c44f79216510d405f057ae454 (diff) | |
parent | 997362de5aab00f8d258b6fe8a058a8b3e018694 (diff) | |
download | frost-bf55dbf9b46cd8826987ee6e556307e24f3d46cc.tar.gz frost-bf55dbf9b46cd8826987ee6e556307e24f3d46cc.tar.bz2 frost-bf55dbf9b46cd8826987ee6e556307e24f3d46cc.zip |
Merge pull request #1770 from AllanWang/hilt
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt index aa38fffd..61c69f10 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Security.kt @@ -31,18 +31,21 @@ fun SettingsActivity.getSecurityPrefs(): KPrefAdapterBuilder.() -> Unit = { descRes = R.string.security_disclaimer_info } - checkbox(R.string.enable_biometrics, prefs::biometricsEnabled, { - launch { + checkbox( + R.string.enable_biometrics, prefs::biometricsEnabled, + { + launch { /* * For security, we should request authentication when: * - enabling to ensure that it is supported * - disabling to ensure that it is permitted */ - BiometricUtils.authenticate(this@getSecurityPrefs, prefs, force = true).await() - prefs.biometricsEnabled = it - reloadByTitle(R.string.enable_biometrics) + BiometricUtils.authenticate(this@getSecurityPrefs, prefs, force = true).await() + prefs.biometricsEnabled = it + reloadByTitle(R.string.enable_biometrics) + } } - }) { + ) { descRes = R.string.enable_biometrics_desc enabler = { BiometricUtils.isSupported(this@getSecurityPrefs) } } |