gaoshuaixing %!s(int64=4) %!d(string=hai) anos
pai
achega
71f7057ace
Modificáronse 1 ficheiros con 0 adicións e 28 borrados
  1. 0 28
      electron/lib/AutoLaunch.js

+ 0 - 28
electron/lib/AutoLaunch.js

@@ -1,28 +0,0 @@
-const { app } = require('electron');
-const { LOGIN_SETTING_OPTIONS } = require('./constant').AutoLaunch;
-
-class AutoLaunch {
-  enable () {
-    const enabled = app.getLoginItemSettings(LOGIN_SETTING_OPTIONS).openAtLogin;
-    if (enabled) {
-      return true;
-    }
-    app.setLoginItemSettings({
-      ...LOGIN_SETTING_OPTIONS,
-      openAtLogin: true
-    })
-    return true;
-  }
-  
-  disable () {
-    app.setLoginItemSettings({ openAtLogin: false })
-    return true;
-  }
-
-  isEnabled () {
-    const enabled = app.getLoginItemSettings(LOGIN_SETTING_OPTIONS).openAtLogin;
-    return enabled;
-  }
-}
-
-module.exports = AutoLaunch;