gaoshuaixing 4 anni fa
parent
commit
71f7057ace
1 ha cambiato i file con 0 aggiunte e 28 eliminazioni
  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;