Fix default server fallback
This commit is contained in:
parent
f298f3c168
commit
a1cb050ead
2 changed files with 4 additions and 3 deletions
|
|
@ -26,7 +26,8 @@ Vue.config.productionTip = false
|
|||
Vue.use(VueResize);
|
||||
Vue.use(VEmojiPicker);
|
||||
Vue.use(matrix, { store: store, i18n: i18n });
|
||||
Vue.use(config); // Use this before cleaninsights below, it depends on config!
|
||||
// eslint-disable-next-line
|
||||
Vue.use(config, globalThis.window.location.origin); // Use this before cleaninsights below, it depends on config!
|
||||
Vue.use(analytics);
|
||||
Vue.use(VueClipboard);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue