diff --git a/front/src/components/SetInstanceModal.vue b/front/src/components/SetInstanceModal.vue
index 7114e4551..fb2647cac 100644
--- a/front/src/components/SetInstanceModal.vue
+++ b/front/src/components/SetInstanceModal.vue
@@ -1,6 +1,67 @@
+
+
-
@@ -101,114 +162,5 @@
-
+
-
-
diff --git a/front/src/store/instance.ts b/front/src/store/instance.ts
index 7ac0da73a..519a8c6af 100644
--- a/front/src/store/instance.ts
+++ b/front/src/store/instance.ts
@@ -53,13 +53,12 @@ const logger = useLogger()
// 1. use the url provided in settings.json, if any
// 2. use the url specified when building via VUE_APP_INSTANCE_URL
// 3. use the current url
-const instanceUrl = import.meta.env.VUE_APP_INSTANCE_URL as string || location.origin
+const instanceUrl = import.meta.env.VUE_APP_INSTANCE_URL as string ?? location.origin
const store: Module = {
namespaced: true,
state: {
frontSettings: {
- // TODO (wvffle): Remove all checks if the variable exists
defaultServerUrl: instanceUrl,
additionalStylesheets: []
},
@@ -143,10 +142,10 @@ const store: Module = {
relativeUrl = relativeUrl.slice(1)
}
- const instanceUrl = state.instanceUrl ?? location.origin
- return instanceUrl + relativeUrl
+ return (state.instanceUrl ?? instanceUrl) + relativeUrl
},
- domain: (state) => new URL(state.instanceUrl ?? location.origin).hostname
+ domain: (state) => new URL(state.instanceUrl ?? instanceUrl).hostname,
+ defaultInstance: () => instanceUrl
},
actions: {
setUrl ({ commit }, url) {