Remove legacy url if one was parsed
This commit is contained in:
parent
614f0b9774
commit
0a71b3dac8
12
src/App.vue
12
src/App.vue
@ -87,6 +87,18 @@ export default defineComponent({
|
|||||||
const parsedUrl = Util.parseUrl();
|
const parsedUrl = Util.parseUrl();
|
||||||
|
|
||||||
if(parsedUrl) {
|
if(parsedUrl) {
|
||||||
|
//Remove legacy url if one was parsed
|
||||||
|
if(parsedUrl.legacy) {
|
||||||
|
const url = new URL(window.location.href);
|
||||||
|
url.searchParams.delete('worldname');
|
||||||
|
url.searchParams.delete('mapname');
|
||||||
|
url.searchParams.delete('x');
|
||||||
|
url.searchParams.delete('y');
|
||||||
|
url.searchParams.delete('z');
|
||||||
|
url.searchParams.delete('zoom');
|
||||||
|
history.replaceState({}, '', url.toString());
|
||||||
|
}
|
||||||
|
|
||||||
store.commit(MutationTypes.SET_PARSED_URL, parsedUrl);
|
store.commit(MutationTypes.SET_PARSED_URL, parsedUrl);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -150,5 +150,6 @@ export const state: State = {
|
|||||||
map: undefined,
|
map: undefined,
|
||||||
location: undefined,
|
location: undefined,
|
||||||
zoom: undefined,
|
zoom: undefined,
|
||||||
|
legacy: false,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user