Add setting to disable biometric auto prompt on desktop (#370)

* Add setting to disable biometric auto prompt on desktop

* Add callback for checking if the window is visible.
This commit is contained in:
Oscar Hinton 2021-05-06 19:41:51 +02:00 committed by GitHub
parent d184b0d2d6
commit 1b8f6aace2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,7 @@ export default class BiometricDarwinMain implements BiometricMain {
async init() {
this.storageService.save(ElectronConstants.enableBiometric, await this.supportsBiometric());
this.storageService.save(ConstantsService.biometricText, 'unlockWithTouchId');
this.storageService.save(ElectronConstants.noAutoPromptBiometricsText, 'noAutoPromptTouchId');
ipcMain.on('biometric', async (event: any, message: any) => {
event.returnValue = await this.requestCreate();

View File

@ -27,6 +27,7 @@ export default class BiometricWindowsMain implements BiometricMain {
}
this.storageService.save(ElectronConstants.enableBiometric, supportsBiometric);
this.storageService.save(ConstantsService.biometricText, 'unlockWithWindowsHello');
this.storageService.save(ElectronConstants.noAutoPromptBiometricsText, 'noAutoPromptWindowsHello');
ipcMain.on('biometric', async (event: any, message: any) => {
event.returnValue = await this.requestCreate();

View File

@ -10,4 +10,6 @@ export class ElectronConstants {
static readonly enableBrowserIntegrationFingerprint: string = 'enableBrowserIntegrationFingerprint';
static readonly alwaysShowDock: string = 'alwaysShowDock';
static readonly openAtLogin: string = 'openAtLogin';
static readonly noAutoPromptBiometrics: string = 'noAutoPromptBiometrics';
static readonly noAutoPromptBiometricsText: string = 'noAutoPromptBiometricsText';
}

View File

@ -37,6 +37,10 @@ export class ElectronMainMessagingService implements MessagingService {
});
});
ipcMain.handle('windowVisible', () => {
return windowMain.win?.isVisible();
});
nativeTheme.on('updated', () => {
windowMain.win.webContents.send('systemThemeUpdated', nativeTheme.shouldUseDarkColors ? 'dark' : 'light');
});