1
0
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:
Laurent Cozic 2023-01-05 13:29:19 +00:00
parent 1edb345e85
commit 9eff7e6060

View File

@ -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,
};