From aeb280e4b2af11eadc75f8bb1deb6478704daaa9 Mon Sep 17 00:00:00 2001 From: Ramiro Saenz Date: Mon, 17 Apr 2017 20:03:05 -0300 Subject: [PATCH] Added command parameter to prevent update "--without-update" Fixes #647 --- app/Application.js | 2 +- electron/main.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Application.js b/app/Application.js index 79a76390..fe6974a2 100644 --- a/app/Application.js +++ b/app/Application.js @@ -34,7 +34,7 @@ Ext.define('Rambox.Application', { Rambox.ux.Auth0.init(); // Check for updates - Rambox.app.checkUpdate(true); + if ( require('electron').remote.process.argv.indexOf('--without-update') === -1 ) Rambox.app.checkUpdate(true); // Add shortcuts to switch services using CTRL + Number var map = new Ext.util.KeyMap({ diff --git a/electron/main.js b/electron/main.js index f613a45c..8d9cd71e 100644 --- a/electron/main.js +++ b/electron/main.js @@ -156,7 +156,7 @@ function createWindow () { tray.create(mainWindow, config); - if ( fs.existsSync(path.resolve(path.dirname(process.execPath), '..', 'Update.exe')) ) updater.initialize(mainWindow); + if ( fs.existsSync(path.resolve(path.dirname(process.execPath), '..', 'Update.exe')) && process.argv.indexOf('--without-update') === -1 ) updater.initialize(mainWindow); // Open links in default browser mainWindow.webContents.on('new-window', function(e, url, frameName, disposition, options) { @@ -184,7 +184,7 @@ function createWindow () { // Navigate the window forward when the user hits their mouse forward button if ( cmd === 'browser-forward' ) mainWindow.webContents.executeJavaScript('if(Ext.cq1("app-main")) Ext.cq1("app-main").getActiveTab().goForward();'); }); - + // Emitted when the window is closed. mainWindow.on('close', function(e) { if ( !isQuitting ) {