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

Commit

Permalink
Merge pull request #9999 from brave/updater-perf
Browse files Browse the repository at this point in the history
Optimize check for updates
  • Loading branch information
bsclifton committed Jul 17, 2017
1 parent 4fe2221 commit a5681cf
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,16 @@ var requestVersionInfo = (done, pingOnly) => {
if (!platformBaseUrl) throw new Error('platformBaseUrl not set')

// Get the daily, week of year and month update checks
var lastCheckYMD = AppStore.getState().toJS().updates['lastCheckYMD'] || null
const state = AppStore.getState()
var lastCheckYMD = state.getIn(['updates', 'lastCheckYMD']) || null
debug(`lastCheckYMD = ${lastCheckYMD}`)

var lastCheckWOY = AppStore.getState().toJS().updates['lastCheckWOY'] || null
var lastCheckWOY = state.getIn(['updates', 'lastCheckWOY']) || null
debug(`lastCheckWOY = ${lastCheckWOY}`)

var lastCheckMonth = AppStore.getState().toJS().updates['lastCheckMonth'] || null
var lastCheckMonth = state.getIn(['updates', 'lastCheckMonth']) || null
debug(`lastCheckMonth = ${lastCheckMonth}`)

// Has the browser ever asked for an update
var firstCheckMade = AppStore.getState().toJS().updates['firstCheckMade'] || false
var firstCheckMade = state.getIn(['updates', 'firstCheckMade']) || false
debug(`firstCheckMade = ${firstCheckMade}`)

// Build query string based on the last date an update request was made
Expand Down

0 comments on commit a5681cf

Please sign in to comment.