Save biometry column
This commit is contained in:
parent
9f3b932189
commit
bb09aa09c7
|
@ -57,16 +57,26 @@ export const localAuthenticate = async(server) => {
|
|||
// Make sure splash screen has been hidden
|
||||
RNBootSplash.hide();
|
||||
|
||||
const isEnrolled = await LocalAuthentication.isEnrolledAsync();
|
||||
const isSupported = await LocalAuthentication.supportedAuthenticationTypesAsync();
|
||||
// if biometry is enabled on the app
|
||||
if (serverRecord?.biometry) {
|
||||
const isEnrolled = await LocalAuthentication.isEnrolledAsync();
|
||||
const isSupported = await LocalAuthentication.supportedAuthenticationTypesAsync();
|
||||
|
||||
// if biometry is enabled and enrolled on OS
|
||||
if (isEnrolled && isSupported) {
|
||||
// opens biometry prompt
|
||||
const authResult = await LocalAuthentication.authenticateAsync({ disableDeviceFallback: true });
|
||||
if (authResult?.success) {
|
||||
await resetAttempts();
|
||||
await saveLastLocalAuthenticationSession(server, serverRecord);
|
||||
// if biometry is enabled and enrolled on OS
|
||||
if (isEnrolled && isSupported?.length) {
|
||||
// opens biometry prompt
|
||||
let authResult;
|
||||
try {
|
||||
authResult = await LocalAuthentication.authenticateAsync({ disableDeviceFallback: true });
|
||||
} catch (e) {
|
||||
// Do nothing
|
||||
}
|
||||
if (authResult?.success) {
|
||||
await resetAttempts();
|
||||
await saveLastLocalAuthenticationSession(server, serverRecord);
|
||||
} else {
|
||||
await localPasscode();
|
||||
}
|
||||
} else {
|
||||
await localPasscode();
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ class ScreenLockConfigView extends React.Component {
|
|||
this.setState({
|
||||
autoLock: this.serverRecord?.autoLock,
|
||||
autoLockTime: this.serverRecord?.autoLockTime || 1800,
|
||||
biometry: this.serverRecord?.biometry || true
|
||||
biometry: this.serverRecord.biometry === null ? true : this.serverRecord.biometry
|
||||
});
|
||||
} catch (error) {
|
||||
// Do nothing
|
||||
|
@ -100,7 +100,7 @@ class ScreenLockConfigView extends React.Component {
|
|||
await this.serverRecord?.update((record) => {
|
||||
record.autoLock = autoLock;
|
||||
record.autoLockTime = autoLockTime;
|
||||
record.biometry = biometry;
|
||||
record.biometry = biometry === null ? true : biometry;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue