mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-13 13:37:31 -07:00
[client] Set config.host to instance domain instead of address.host
This commit is contained in:
parent
9139cba602
commit
66ab00a174
2 changed files with 7 additions and 2 deletions
|
@ -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`;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue