[client] Set config.host to instance domain instead of address.host

This commit is contained in:
Laura Hausmann 2023-08-30 15:24:06 +02:00
parent 9139cba602
commit 66ab00a174
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605
2 changed files with 7 additions and 2 deletions

View File

@ -3,7 +3,11 @@ const siteName = (
document.querySelector('meta[property="og:site_name"]') as HTMLMetaElement
)?.content;
export const host = address.host;
export function setHost(newHost: string): void {
host = newHost;
}
export let host = address.host;
export const hostname = address.hostname;
export const url = address.origin;
export const apiUrl = `${url}/api`;

View File

@ -32,7 +32,7 @@ import { compareVersions } from "compare-versions";
import widgets from "@/widgets";
import directives from "@/directives";
import components from "@/components";
import { version, ui, lang, host } from "@/config";
import { version, ui, lang, setHost } from "@/config";
import { applyTheme } from "@/scripts/theme";
import { isDeviceDarkmode } from "@/scripts/is-device-darkmode";
import { i18n } from "@/i18n";
@ -180,6 +180,7 @@ function checkForSplash() {
fetchInstanceMetaPromise.then(() => {
localStorage.setItem("v", instance.version);
setHost(new URL(instance.uri).host);
// Init service worker
initializeSw();