Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
Add setting to disable biometric auto prompt on desktop (#370)
Browse files Browse the repository at this point in the history
* Add setting to disable biometric auto prompt on desktop

* Add callback for checking if the window is visible.
  • Loading branch information
Hinton committed May 6, 2021
1 parent d184b0d commit 1b8f6aa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/electron/biometric.darwin.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/electron/biometric.windows.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions src/electron/electronConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
4 changes: 4 additions & 0 deletions src/electron/services/electronMainMessaging.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down

0 comments on commit 1b8f6aa

Please sign in to comment.