diff --git a/client/package.json b/client/package.json index 061ee7c..7a2df12 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "knowyt", - "version": "3.4", + "version": "3.5", "private": true, "scripts": { "lint": "tsc-strict", diff --git a/client/src/components/CopyrightNotice.vue b/client/src/components/CopyrightNotice.vue index 061ab03..1c21ef2 100644 --- a/client/src/components/CopyrightNotice.vue +++ b/client/src/components/CopyrightNotice.vue @@ -1,6 +1,6 @@ diff --git a/client/src/composables/engine/fetchUpdate.ts b/client/src/composables/engine/fetchUpdate.ts index 9cd926b..d69a759 100644 --- a/client/src/composables/engine/fetchUpdate.ts +++ b/client/src/composables/engine/fetchUpdate.ts @@ -81,17 +81,31 @@ export async function fetchUpdate(this: EngineContext) { const { status, statusText } = e.response if (status == 200) { delay = 1000 - } else { + } else if (status == 403) { + // credentials not valid any more + this.retry.value = -1 + this.isActive = false + this.shouldStop = false + document.location.pathname = '/' + return + } else { console.warn(`HTTP ${status} ${statusText}`) - if (this.retry.value <= 15) { - delay = 1000 - } else { + if (this.retry.value > 30) { + // after 90s give up + this.retry.value = -1 + this.isActive = false + this.shouldStop = false + document.location.pathname = '/' + return + } else if (this.retry.value > 15) { delay = 5000 + } else { + delay = 1000 } this.version = -1 } } else { - // request aborted or other causes + // request aborted or other causes, stop fetching console.warn(e.message) this.retry.value = -1