Only reset splash screen state on server changes, reset loading attempts correctly.

This commit is contained in:
James Lyne 2021-09-01 18:14:19 +01:00
parent 78655e7ebe
commit ab5ede1ccc
2 changed files with 13 additions and 10 deletions

View File

@ -71,7 +71,7 @@ export default defineComponent({
loadConfiguration = async () => { loadConfiguration = async () => {
try { try {
clearTimeout(loadingTimeout); clearTimeout(loadingTimeout);
showSplash(); showSplash(!loadingAttempts.value);
loading.value = true; loading.value = true;
await store.dispatch(ActionTypes.STOP_UPDATES, undefined); await store.dispatch(ActionTypes.STOP_UPDATES, undefined);
@ -186,6 +186,7 @@ export default defineComponent({
return; return;
} }
loadingAttempts.value = 0;
window.history.replaceState({}, '', newServer.id); window.history.replaceState({}, '', newServer.id);
loadConfiguration(); loadConfiguration();
}, {deep: true}); }, {deep: true});

View File

@ -21,11 +21,12 @@ const app = document.getElementById('app'),
splashErrorMessage = document.getElementById('splash__error-message'), splashErrorMessage = document.getElementById('splash__error-message'),
splashRetry = document.getElementById('splash__error-retry'); splashRetry = document.getElementById('splash__error-retry');
export const showSplash = function() { export const showSplash = function(reset: boolean) {
if(!splash || !app) { if(!splash || !app) {
return; return;
} }
if(reset) {
if(splashError) { if(splashError) {
splashError.setAttribute('aria-hidden', 'true'); splashError.setAttribute('aria-hidden', 'true');
} }
@ -37,6 +38,7 @@ export const showSplash = function() {
if(splashRetry) { if(splashRetry) {
splashRetry.hidden = true; splashRetry.hidden = true;
} }
}
splash.hidden = false; splash.hidden = false;
app.setAttribute('aria-hidden', 'true'); app.setAttribute('aria-hidden', 'true');