engine: reset version on fetch error

This commit is contained in:
Settel 2021-07-30 21:49:39 +02:00
parent caa1c06ccf
commit d08ed2add8
2 changed files with 5 additions and 2 deletions

View File

@ -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)
}
}

View File

@ -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
},
}