mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2025-03-04 07:18:50 -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
|
document.querySelector('meta[property="og:site_name"]') as HTMLMetaElement
|
||||||
)?.content;
|
)?.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 hostname = address.hostname;
|
||||||
export const url = address.origin;
|
export const url = address.origin;
|
||||||
export const apiUrl = `${url}/api`;
|
export const apiUrl = `${url}/api`;
|
||||||
|
|
|
@ -32,7 +32,7 @@ import { compareVersions } from "compare-versions";
|
||||||
import widgets from "@/widgets";
|
import widgets from "@/widgets";
|
||||||
import directives from "@/directives";
|
import directives from "@/directives";
|
||||||
import components from "@/components";
|
import components from "@/components";
|
||||||
import { version, ui, lang, host } from "@/config";
|
import { version, ui, lang, setHost } from "@/config";
|
||||||
import { applyTheme } from "@/scripts/theme";
|
import { applyTheme } from "@/scripts/theme";
|
||||||
import { isDeviceDarkmode } from "@/scripts/is-device-darkmode";
|
import { isDeviceDarkmode } from "@/scripts/is-device-darkmode";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
|
@ -180,6 +180,7 @@ function checkForSplash() {
|
||||||
|
|
||||||
fetchInstanceMetaPromise.then(() => {
|
fetchInstanceMetaPromise.then(() => {
|
||||||
localStorage.setItem("v", instance.version);
|
localStorage.setItem("v", instance.version);
|
||||||
|
setHost(new URL(instance.uri).host);
|
||||||
|
|
||||||
// Init service worker
|
// Init service worker
|
||||||
initializeSw();
|
initializeSw();
|
||||||
|
|
Loading…
Add table
Reference in a new issue