mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-02 08:40:08 +01:00
dont use powerMonitor on snaps
This commit is contained in:
parent
6e53e9b441
commit
fea8ab5921
@ -2,6 +2,8 @@ import { powerMonitor } from 'electron';
|
||||
|
||||
import { ConstantsService } from 'jslib/services/constants.service';
|
||||
|
||||
import { isSnapStore } from 'jslib/electron/utils';
|
||||
|
||||
import { Main } from '../main';
|
||||
|
||||
// tslint:disable-next-line
|
||||
@ -15,13 +17,16 @@ export class PowerMonitorMain {
|
||||
constructor(private main: Main) { }
|
||||
|
||||
init() {
|
||||
// System sleep
|
||||
powerMonitor.on('suspend', async () => {
|
||||
const lockOption = await this.getLockOption();
|
||||
if (lockOption === -3) {
|
||||
this.main.messagingService.send('lockVault');
|
||||
}
|
||||
});
|
||||
// ref: https://github.com/electron/electron/issues/13767
|
||||
if (!isSnapStore()) {
|
||||
// System sleep
|
||||
powerMonitor.on('suspend', async () => {
|
||||
const lockOption = await this.getLockOption();
|
||||
if (lockOption === -3) {
|
||||
this.main.messagingService.send('lockVault');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// System idle
|
||||
global.setInterval(async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user