1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

lock on system locked

This commit is contained in:
Kyle Spearrin
2019-03-19 16:12:26 -04:00
parent cd7b9bd449
commit 5d7f73b263
2 changed files with 18 additions and 4 deletions

View File

@@ -28,6 +28,16 @@ export class PowerMonitorMain {
});
}
if (process.platform !== 'linux') {
// System locked
powerMonitor.on('lock-screen', async () => {
const lockOption = await this.getLockOption();
if (lockOption === -2) {
this.main.messagingService.send('lockVault');
}
});
}
// System idle
global.setInterval(async () => {
const idleSeconds: number = desktopIdle.getIdleTime();
@@ -45,8 +55,6 @@ export class PowerMonitorMain {
this.idle = idle;
}, IdleCheckInterval);
// TODO: System locked
}
private getLockOption(): Promise<number> {