From 2671a618e20cf77dc1a93e86c88fd51657352b90 Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Fri, 14 Dec 2018 15:55:28 -0700 Subject: [PATCH] Trigger an update check on launch (after 5 seconds) Only occurs if user does NOT have Brave Core installed. --- app/index.js | 9 +++++++++ js/about/newtab.js | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/index.js b/app/index.js index 6bdfc9ffca9..22469809e70 100644 --- a/app/index.js +++ b/app/index.js @@ -374,6 +374,15 @@ app.on('ready', () => { process.on(messages.CHECK_FOR_UPDATE, () => updater.checkForUpdate(true)) ipcMain.on(messages.CHECK_FOR_UPDATE, () => updater.checkForUpdate(true)) + // if user does NOT have brave-core installed, trigger an update + // so that banner is shown. Delayed so updater can initialize. + const braveCoreInstalled = initialImmutableState.getIn(['about', 'init', 'braveCoreInstalled']) || false + if (!braveCoreInstalled) { + setTimeout(() => { + updater.checkForUpdate(true) + }, 5 * 1000) + } + // This is fired from a auto-update metadata call process.on(messages.UPDATE_META_DATA_RETRIEVED, (metadata) => { console.log(metadata) diff --git a/js/about/newtab.js b/js/about/newtab.js index d6dd098f4da..8d93a67b988 100644 --- a/js/about/newtab.js +++ b/js/about/newtab.js @@ -32,7 +32,6 @@ const backgrounds = require('../data/backgrounds') const urlutils = require('../lib/urlutil') const random = require('../../app/common/lib/randomUtil') const cx = require('../lib/classSet') -const {isLinux} = require('../../app/common/lib/platformUtil') const ipc = window.chrome.ipcRenderer // Styles