Fix aborted configuration requests being retried
This commit is contained in:
parent
c5f8644587
commit
0bdd4b3d44
@ -57,6 +57,11 @@ export default defineComponent({
|
||||
startUpdates();
|
||||
requestAnimationFrame(() => window.hideSplash());
|
||||
} catch(e) {
|
||||
//Request was aborted, probably because another server was selected before the request finished. Don't retry
|
||||
if(e instanceof DOMException && e.name === 'AbortError') {
|
||||
return;
|
||||
}
|
||||
|
||||
const error = `Failed to load server configuration for '${store.state.currentServer}'`;
|
||||
console.error(`${error}:`, e);
|
||||
window.showSplashError(`${error}\n${e}`, false, ++configAttempts.value);
|
||||
@ -75,6 +80,10 @@ export default defineComponent({
|
||||
await store.dispatch(ActionTypes.GET_UPDATE, undefined);
|
||||
} finally {
|
||||
if(updatesEnabled.value) {
|
||||
if(updateTimeout.value) {
|
||||
clearTimeout(updateTimeout.value);
|
||||
}
|
||||
|
||||
updateTimeout.value = setTimeout(() => update(), updateInterval.value);
|
||||
}
|
||||
}
|
||||
|
@ -653,7 +653,8 @@ async function fetchJSON(url: string, signal: AbortSignal) {
|
||||
response = await fetch(url, {signal});
|
||||
} catch(e) {
|
||||
if(e instanceof DOMException && e.name === 'AbortError') {
|
||||
console.warn('Request aborted');
|
||||
console.warn(`Request aborted (${url}`);
|
||||
throw e;
|
||||
} else {
|
||||
console.error(e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user