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:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user