From 3ebd90565c37f07c29c23d1eb217a853c2a3a83b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 3 Jun 2017 15:31:08 +0100 Subject: [PATCH] add clearer concept of timeout vs error Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> (cherry picked from commit 104c804) Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/globals/UpdateCheckBar.js | 9 ++++++--- src/vector/platform/ElectronPlatform.js | 2 +- src/vector/platform/VectorBasePlatform.js | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/views/globals/UpdateCheckBar.js b/src/components/views/globals/UpdateCheckBar.js index 95c78cf6..c39754c8 100644 --- a/src/components/views/globals/UpdateCheckBar.js +++ b/src/components/views/globals/UpdateCheckBar.js @@ -45,13 +45,16 @@ export default React.createClass({ let message; switch (state) { case updateStateEnum.ERROR: - message = 'Error encountered when checking for an update'; + message = 'Error encountered when checking for an update.'; + break; + case updateStateEnum.TIMEOUT: + message = 'Update Check timed out, try again later.'; break; case updateStateEnum.NOTAVAILABLE: - message = 'No update found'; + message = 'No update found.'; break; case updateStateEnum.DOWNLOADING: - message = 'Update is being downloaded'; + message = 'Update is being downloaded.'; done = false; break; } diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index b4f17d6e..f84fe8d5 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -158,7 +158,7 @@ export default class ElectronPlatform extends VectorBasePlatform { return deferred.promise.timeout(10000).catch(() => { electron.autoUpdater.removeListener('update-not-available', _onUpdateNotAvailable); electron.autoUpdater.removeListener('update-available', _onUpdateAvailable); - return updateStateEnum.ERROR; + return updateStateEnum.TIMEOUT; }); } diff --git a/src/vector/platform/VectorBasePlatform.js b/src/vector/platform/VectorBasePlatform.js index 0bbcb8f3..074be91c 100644 --- a/src/vector/platform/VectorBasePlatform.js +++ b/src/vector/platform/VectorBasePlatform.js @@ -24,6 +24,7 @@ import Favico from 'favico.js'; export const updateStateEnum = { ERROR: 'ERROR', + TIMEOUT: 'TIMEOUT', NOTAVAILABLE: 'NOTAVAILABLE', DOWNLOADING: 'DOWNLOADING', READY: 'READY',