Update url when its contains an unknown server
This commit is contained in:
parent
1173dcbbce
commit
58009adfef
@ -93,6 +93,11 @@ API.validateConfiguration().then((config) => {
|
|||||||
const lastSegment = window.location.pathname.split('/').pop(),
|
const lastSegment = window.location.pathname.split('/').pop(),
|
||||||
serverName = lastSegment && config.has(lastSegment) ? lastSegment : config.keys().next().value;
|
serverName = lastSegment && config.has(lastSegment) ? lastSegment : config.keys().next().value;
|
||||||
|
|
||||||
|
//Update url if server doesn't exist
|
||||||
|
if(serverName !== lastSegment) {
|
||||||
|
window.history.replaceState({}, '', store.state.servers.get(serverName)!.url + window.location.hash);
|
||||||
|
}
|
||||||
|
|
||||||
store.commit(MutationTypes.SET_CURRENT_SERVER, serverName);
|
store.commit(MutationTypes.SET_CURRENT_SERVER, serverName);
|
||||||
} else {
|
} else {
|
||||||
store.commit(MutationTypes.SET_CURRENT_SERVER, config.keys().next().value);
|
store.commit(MutationTypes.SET_CURRENT_SERVER, config.keys().next().value);
|
||||||
|
Loading…
Reference in New Issue
Block a user