mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-30 08:26:59 +02:00
Mobile: Fixed biometics prompt on new devices
This commit is contained in:
parent
1edb345e85
commit
9eff7e6060
@ -8,29 +8,26 @@ export interface SensorInfo {
|
||||
}
|
||||
|
||||
export default async (): Promise<SensorInfo> => {
|
||||
const enabled = Setting.value('security.biometricsEnabled');
|
||||
let hasChanged = false;
|
||||
let supportedSensors = '';
|
||||
|
||||
if (enabled) {
|
||||
try {
|
||||
const result = await FingerprintScanner.isSensorAvailable();
|
||||
supportedSensors = result;
|
||||
try {
|
||||
const result = await FingerprintScanner.isSensorAvailable();
|
||||
supportedSensors = result;
|
||||
|
||||
if (result) {
|
||||
if (result !== Setting.value('security.biometricsSupportedSensors')) {
|
||||
hasChanged = true;
|
||||
Setting.setValue('security.biometricsSupportedSensors', result);
|
||||
}
|
||||
if (result) {
|
||||
if (result !== Setting.value('security.biometricsSupportedSensors')) {
|
||||
hasChanged = true;
|
||||
Setting.setValue('security.biometricsSupportedSensors', result);
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('Could not check for biometrics sensor:', error);
|
||||
Setting.setValue('security.biometricsSupportedSensors', '');
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('Could not check for biometrics sensor:', error);
|
||||
Setting.setValue('security.biometricsSupportedSensors', '');
|
||||
}
|
||||
|
||||
return {
|
||||
enabled,
|
||||
enabled: Setting.value('security.biometricsEnabled'),
|
||||
sensorsHaveChanged: hasChanged,
|
||||
supportedSensors,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user