diff --git a/package.json b/package.json index e7f5da8..3537d53 100755 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "colors": "^1.1.2", "cross-env": "^3.1.4", "devtron": "^1.4.0", - "electron": "^1.6.2", + "electron": "^1.6.6", "electron-builder": "^17.1.1", "stylus": "^0.54.5", "stylus-loader": "^3.0.1", diff --git a/store/index.js b/store/index.js index 330775c..1c3e9ba 100644 --- a/store/index.js +++ b/store/index.js @@ -76,6 +76,10 @@ const store = new Vuex.Store({ state.config = config }, + setErrorSnackbar(state, data) { + state.errorSnackbar.text = data + state.errorSnackbar.show = true + }, setCurrentSeason(state, data) { state.year = data.year state.season = data.season @@ -147,17 +151,18 @@ const store = new Vuex.Store({ } }, actions: { - async releasesInit({state, commit, dispatch}) { + async releasesInit({state, commit}) { console.log('[INIT] Releases') const {data, status} = await axios.get(`releases.json?fansub=${state.releaseFansub}&quality=${state.releaseQuality}`) if (status === 200) commit('setReleases', data) else { - state.errorSnackBar.text = 'An error occurred while getting the latest releases. Retrying in 30 seconds.' - setTimeout(() => { + console.log(`[${(new Date()).toLocaleTimeString()}]: An error occurred while getting the latest releases. Retrying in 30 seconds.`) + commit('setErrorSnackbar', 'Could not get the latest releases. Retrying in 30 seconds.') + setTimeout(function () { console.log(`[${(new Date()).toLocaleTimeString()}]: Retrying to get latest releases.`) - dispatch('releasesInit') + store.dispatch('releasesInit') }, 30 * 1000) } }