From d08ed2add8b96bd4575091e9b2c65ada528ebb47 Mon Sep 17 00:00:00 2001 From: Settel Date: Fri, 30 Jul 2021 21:49:39 +0200 Subject: [PATCH] engine: reset version on fetch error --- client/src/plugins/engine.js | 2 +- client/src/store/engine.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/plugins/engine.js b/client/src/plugins/engine.js index d914b99..f602521 100644 --- a/client/src/plugins/engine.js +++ b/client/src/plugins/engine.js @@ -1,4 +1,3 @@ - export default (context, inject) => { const { store, $axios } = context @@ -18,6 +17,7 @@ export default (context, inject) => { if (status >= 500) { console.warn(`HTTP ${status} ${statusText}`) delay = 5000 + store.commit('engine/setVersion', -1) } } diff --git a/client/src/store/engine.js b/client/src/store/engine.js index 56493d0..6c85ddb 100644 --- a/client/src/store/engine.js +++ b/client/src/store/engine.js @@ -7,5 +7,8 @@ export const mutations = { setJson(state, json) { state.json = json state.version = parseInt(json.version, 10) - } + }, + setVersion(state, version) { + state.version = version + }, }