diff --git a/src/app/main.js b/src/app/main.js index bef9f7d..8ad1f6e 100755 --- a/src/app/main.js +++ b/src/app/main.js @@ -3,11 +3,6 @@ const {app, BrowserWindow} = require('electron') const path = require('path') const Menu = require('electron').Menu -// Reload the application if the source code it's changed -require('electron-reload')(__dirname, { - electron: path.join(__dirname, 'node_modules', '.bin', 'electron') -}); - // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. let mainWindow diff --git a/src/app/update.js b/src/app/update.js index dc2d001..98e70e1 100644 --- a/src/app/update.js +++ b/src/app/update.js @@ -26,10 +26,15 @@ const remote = require('electron').remote; exec('php ' + update_script, function (error, stdout, stderr) { console.log(stdout); + // Reload the application if the source code it's changed + require('electron-reload')(__dirname, { + electron: path.join(__dirname, 'node_modules', '.bin', 'electron') + }); + setTimeout(function() { // Close the application if electron-reload doesn't detect a source change remote.app.quit(); - }, 5000); + }, 2000); }); });