Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
[Add] Electron Reload Fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
abdyfranco committed Jun 5, 2019
1 parent 4cfb9b8 commit e6869c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/app/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

Expand Down

0 comments on commit e6869c6

Please sign in to comment.