Skip to content

Commit

Permalink
add check update error by toggling dev tool
Browse files Browse the repository at this point in the history
  • Loading branch information
doviettung96 committed Jun 26, 2017
1 parent 2ffc389 commit 85b8a46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ const url = require("url");
// 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;

let updaterError = false;
// this part is for autoupdater
const updateFeed = "https://github.com/doviettung96/TungDV_Node_Express_EJS_Mysql/releases";

autoUpdater.on('update-downloaded', () => {
autoUpdater.quitAndInstall();
})
autoUpdater.on("error", (ev, err) => {
console.log(err);
updaterError = true;
});

// This method will be called when Electron has finished
Expand Down Expand Up @@ -73,7 +73,8 @@ let createWindow = function () {
mainWindow.focus();

// Open the DevTools.
mainWindow.webContents.openDevTools();
if(updaterError)
mainWindow.webContents.openDevTools();

// Emitted when the window is closed.
mainWindow.on("closed", function () {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Node-Express-EJS-Mysql",
"version": "1.0.7",
"version": "1.0.8",
"description": "A simple app with Node-Express-EJS-Mysql",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit 85b8a46

Please sign in to comment.