Clear player head cache/queue on server change

This commit is contained in:
James Lyne 2022-01-17 20:15:22 +00:00
parent b82c9f39d2
commit 4535af754c
2 changed files with 7 additions and 1 deletions

View File

@ -29,7 +29,7 @@ import Sidebar from './components/Sidebar.vue';
import ChatBox from './components/ChatBox.vue';
import {useStore} from "@/store";
import {ActionTypes} from "@/store/action-types";
import {parseUrl} from '@/util';
import {clearHeadCache, parseUrl} from '@/util';
import {hideSplash, showSplash, showSplashError} from '@/util/splash';
import {MutationTypes} from "@/store/mutation-types";
import {LiveAtlasServerDefinition, LiveAtlasUIElement} from "@/index";
@ -170,6 +170,7 @@ export default defineComponent({
return;
}
clearHeadCache();
loadingAttempts.value = 0;
window.history.replaceState({}, '', newServer.id);
loadConfiguration();

View File

@ -126,6 +126,11 @@ const tickHeadQueue = () => {
tickHeadQueue();
}
export const clearHeadCache = () => {
headCache.clear();
headQueue.splice(0);
}
export const parseUrl = (url: URL) => {
const query = new URLSearchParams(url.search),
hash = url.hash.replace('#', '');