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

Commit

Permalink
Trigger an update check on launch (after 5 seconds)
Browse files Browse the repository at this point in the history
Only occurs if user does NOT have Brave Core installed.
  • Loading branch information
bsclifton committed Dec 14, 2018
1 parent 5e50a9f commit 2671a61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion js/about/newtab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2671a61

Please sign in to comment.