Browse Source

修复自动升级问题

gaoshuaixing 4 năm trước cách đây
mục cha
commit
914f8f07f4
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      electron/preferences.js

+ 10 - 0
electron/preferences.js

@@ -1,5 +1,7 @@
 'use strict';
 
+const is = require('electron-is');
+const config = require('./config');
 const shortcut = require('./lib/shortcut');
 const tray = require('./lib/tray');
 const awaken = require('./lib/awaken');
@@ -13,4 +15,12 @@ module.exports = () => {
 
   // awaken 
   awaken.setup();
+
+  // check update
+  const updateConfig = config.get('autoUpdate');
+  if ((is.windows() && updateConfig.windows) || (is.macOS() && updateConfig.macOS)
+    || (is.linux() && updateConfig.linux)) {
+    const autoUpdater = require('./lib/autoUpdater');
+    autoUpdater.checkUpdate();
+  }
 }