From 7a413cf6784bccb04e9378cb35e897dd37da384b Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sat, 1 Dec 2018 22:46:43 +0100 Subject: Work with dev-app-update.yml & switch to debugger --- src/electron/ipc-api/autoUpdate.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/electron/ipc-api/autoUpdate.js') diff --git a/src/electron/ipc-api/autoUpdate.js b/src/electron/ipc-api/autoUpdate.js index db5d9663e..9ccc89ea2 100644 --- a/src/electron/ipc-api/autoUpdate.js +++ b/src/electron/ipc-api/autoUpdate.js @@ -1,17 +1,17 @@ import { app, ipcMain } from 'electron'; import { autoUpdater } from 'electron-updater'; -import { isDevMode } from '../../environment.js'; + +const debug = require('debug')('Franz:ipcApi:autoUpdate'); export default (params) => { - if (!isDevMode && (process.platform === 'darwin' || process.platform === 'win32')) { - // autoUpdater.setFeedURL(updateUrl); + if (process.platform === 'darwin' || process.platform === 'win32') { ipcMain.on('autoUpdate', (event, args) => { try { autoUpdater.allowPrerelease = Boolean(params.settings.app.get('beta')); if (args.action === 'check') { autoUpdater.checkForUpdates(); } else if (args.action === 'install') { - console.log('install update'); + debug('install update'); autoUpdater.quitAndInstall(); // we need to send a quit event setTimeout(() => { @@ -25,12 +25,12 @@ export default (params) => { }); autoUpdater.on('update-not-available', () => { - console.log('update-not-available'); + debug('update-not-available'); params.mainWindow.webContents.send('autoUpdate', { available: false }); }); autoUpdater.on('update-available', () => { - console.log('update-available'); + debug('update-available'); params.mainWindow.webContents.send('autoUpdate', { available: true }); }); @@ -39,16 +39,16 @@ export default (params) => { logMessage = `${logMessage} - Downloaded ${progressObj.percent}%`; logMessage = `${logMessage} (${progressObj.transferred}/${progressObj.total})`; - console.log(logMessage); + debug(logMessage); }); autoUpdater.on('update-downloaded', () => { - console.log('update-downloaded'); + debug('update-downloaded'); params.mainWindow.webContents.send('autoUpdate', { downloaded: true }); }); autoUpdater.on('error', () => { - console.log('update-error'); + debug('update-error'); params.mainWindow.webContents.send('autoUpdate', { error: true }); }); } -- cgit v1.2.3-70-g09d2