Fix default server fallback

This commit is contained in:
N-Pex 2023-02-20 16:51:05 +01:00 committed by n8fr8
parent f298f3c168
commit a1cb050ead
2 changed files with 4 additions and 3 deletions

View file

@ -1,5 +1,5 @@
export default {
install(Vue) {
install(Vue, defaultServerFromLocation) {
var config = Vue.observable(require('@/assets/config.json'));
const getRuntimeConfig = async () => {
const runtimeConfig = await fetch('./config.json');
@ -14,7 +14,7 @@ export default {
}
// If default server is not set, default to current server address
if (!json.defaultServer) {
Vue.set(config, "defaultServer", window.location.origin);
Vue.set(config, "defaultServer", defaultServerFromLocation);
}
});
Vue.prototype.$config = config;