From ae64b136050d4213fd57915cbf6edaaca669093b Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Tue, 18 Jul 2017 07:21:44 -0400 Subject: [PATCH] Use const and Immutable default values for updater Address review comments here: https://github.com/brave/browser-laptop/pull/9999/files#r127599312 Fix #9996 --- app/updater.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/updater.js b/app/updater.js index 102c957dd32..2352c105814 100644 --- a/app/updater.js +++ b/app/updater.js @@ -132,26 +132,26 @@ var requestVersionInfo = (done, pingOnly) => { // Get the daily, week of year and month update checks const state = AppStore.getState() - var lastCheckYMD = state.getIn(['updates', 'lastCheckYMD']) || null + const lastCheckYMD = state.getIn(['updates', 'lastCheckYMD'], null) debug(`lastCheckYMD = ${lastCheckYMD}`) - var lastCheckWOY = state.getIn(['updates', 'lastCheckWOY']) || null + const lastCheckWOY = state.getIn(['updates', 'lastCheckWOY'], null) debug(`lastCheckWOY = ${lastCheckWOY}`) - var lastCheckMonth = state.getIn(['updates', 'lastCheckMonth']) || null + const lastCheckMonth = state.getIn(['updates', 'lastCheckMonth'], null) debug(`lastCheckMonth = ${lastCheckMonth}`) // Has the browser ever asked for an update - var firstCheckMade = state.getIn(['updates', 'firstCheckMade']) || false + const firstCheckMade = state.getIn(['updates', 'firstCheckMade'], false) debug(`firstCheckMade = ${firstCheckMade}`) // Build query string based on the last date an update request was made - var query = paramsFromLastCheckDelta( + const query = paramsFromLastCheckDelta( lastCheckYMD, lastCheckWOY, lastCheckMonth, firstCheckMade ) query.accept_preview = updateToPreviewReleases ? 'true' : 'false' - var queryString = `${platformBaseUrl}?${querystring.stringify(query)}` + const queryString = `${platformBaseUrl}?${querystring.stringify(query)}` debug(queryString) request(queryString, (err, response, body) => {