Fix electron 11 support (#708)

This commit is contained in:
proletarius101 2021-02-04 01:47:44 +08:00 committed by GitHub
parent b93792332e
commit 6dc81a6e01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View File

@ -177,7 +177,6 @@
"entitlementsInherit": "resources/entitlements.mas.inherit.plist", "entitlementsInherit": "resources/entitlements.mas.inherit.plist",
"hardenedRuntime": false, "hardenedRuntime": false,
"asarUnpack": [ "asarUnpack": [
"node_modules/desktop-idle",
"node_modules/keytar" "node_modules/keytar"
] ]
}, },
@ -308,13 +307,12 @@
"big-integer": "1.6.36", "big-integer": "1.6.36",
"browser-hrtime": "^1.1.8", "browser-hrtime": "^1.1.8",
"core-js": "2.6.2", "core-js": "2.6.2",
"desktop-idle": "1.1.2",
"duo_web_sdk": "git+https://github.com/duosecurity/duo_web_sdk.git", "duo_web_sdk": "git+https://github.com/duosecurity/duo_web_sdk.git",
"electron-log": "4.3.0", "electron-log": "4.3.0",
"electron-store": "6.0.1", "electron-store": "6.0.1",
"electron-updater": "4.3.5", "electron-updater": "4.3.5",
"forcefocus": "^1.1.0", "forcefocus": "^1.1.0",
"keytar": "4.13.0", "keytar": "7.3.0",
"lunr": "2.3.3", "lunr": "2.3.3",
"node-forge": "0.7.6", "node-forge": "0.7.6",
"node-ipc": "^9.1.1", "node-ipc": "^9.1.1",

View File

@ -7,7 +7,6 @@ import { isSnapStore } from 'jslib/electron/utils';
import { Main } from '../main'; import { Main } from '../main';
// tslint:disable-next-line // tslint:disable-next-line
const desktopIdle = require('desktop-idle');
const IdleLockSeconds = 5 * 60; // 5 minutes const IdleLockSeconds = 5 * 60; // 5 minutes
const IdleCheckInterval = 30 * 1000; // 30 seconds const IdleCheckInterval = 30 * 1000; // 30 seconds
@ -42,7 +41,7 @@ export class PowerMonitorMain {
// System idle // System idle
global.setInterval(async () => { global.setInterval(async () => {
const idleSeconds: number = desktopIdle.getIdleTime(); const idleSeconds: number = powerMonitor.getSystemIdleTime();
const idle = idleSeconds >= IdleLockSeconds; const idle = idleSeconds >= IdleLockSeconds;
if (idle) { if (idle) {
if (this.idle) { if (this.idle) {

View File

@ -14,15 +14,14 @@
"dependencies": { "dependencies": {
"@nodert-win10-rs4/windows.security.credentials.ui": "^0.4.4", "@nodert-win10-rs4/windows.security.credentials.ui": "^0.4.4",
"big-integer": "1.6.36", "big-integer": "1.6.36",
"desktop-idle": "1.1.2", "browser-hrtime": "^1.1.8",
"electron-log": "4.3.0", "electron-log": "4.3.0",
"electron-store": "6.0.1", "electron-store": "6.0.1",
"electron-updater": "4.3.5", "electron-updater": "4.3.5",
"forcefocus": "^1.1.0", "forcefocus": "^1.1.0",
"keytar": "4.13.0", "keytar": "7.3.0",
"node-ipc": "^9.1.1", "node-ipc": "^9.1.1",
"regedit": "^3.0.3", "regedit": "^3.0.3",
"zxcvbn": "4.4.2", "zxcvbn": "4.4.2"
"browser-hrtime": "^1.1.8"
} }
} }