From 0ccecb08498adcc75e2d6118ff4d9f5b4563d48d Mon Sep 17 00:00:00 2001 From: Kylart Date: Thu, 1 Mar 2018 02:42:53 +0100 Subject: [PATCH] should retryLater only once --- store/modules/releases/actions.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/store/modules/releases/actions.js b/store/modules/releases/actions.js index 7fdba05..e840c31 100644 --- a/store/modules/releases/actions.js +++ b/store/modules/releases/actions.js @@ -74,15 +74,17 @@ export default { log(`Refreshing Releases...`) const retryLater = (backUp) => { - log(`An error occurred while getting the latest releases. Retrying in 45 seconds.`) - commit('setInfoSnackbar', 'Could not get the latest releases. Retrying in 45 seconds.', isRoot) + if (!state.notLoaded) { + log(`An error occurred while getting the latest releases. Retrying in 45 seconds.`) + commit('setInfoSnackbar', 'Could not get the latest releases. Retrying in 45 seconds.', isRoot) - backUp.length && commit('set', {old: backUp}) + backUp.length && commit('set', {old: backUp}) - setTimeout(() => { - log(`Retrying to get latest releases.`) - dispatch('refresh').catch(err => { void (err) }) - }, 45 * 1000) + setTimeout(() => { + log(`Retrying to get latest releases.`) + dispatch('refresh').catch(err => { void (err) }) + }, 45 * 1000) + } } const backUp = state.releases