just leave it null

This commit is contained in:
cutestnekoaqua 2023-04-08 12:03:07 +02:00
parent 5e256b8bce
commit ab06c4d1eb
No known key found for this signature in database
GPG Key ID: 6BF0964A5069C1E0
2 changed files with 4 additions and 6 deletions

View File

@ -1,6 +1,6 @@
import { $i } from "@/account"; import { $i } from "@/account";
// #v-ifdef VITE_CAPACITOR // #v-ifdef VITE_CAPACITOR
const address = $i ? new URL($i.instanceUrl) : new URL("http://localhost"); const address = $i ? new URL($i.instanceUrl) : null;
// #v-else // #v-else
const address = new URL(location.href); const address = new URL(location.href);
// #v-endif // #v-endif
@ -15,11 +15,9 @@ export const url = $i?.instanceUrl;
// #v-else // #v-else
export const url = address.origin; export const url = address.origin;
// #v-endif // #v-endif
export const apiUrl = `${url ? url : "http://localhost"}/api`; export const apiUrl = url + "/api";
export const wsUrl = `${ export const wsUrl = `${
url url.replace("http://", "ws://").replace("https://", "wss://")
? url.replace("http://", "ws://").replace("https://", "wss://")
: "ws://localhost"
}/streaming`; }/streaming`;
export const lang = localStorage.getItem("lang"); export const lang = localStorage.getItem("lang");
export const langs = _LANGS_; export const langs = _LANGS_;

View File

@ -16,7 +16,7 @@ export const pendingApiRequestsCount = ref(0);
const apiClient = new Misskey.api.APIClient({ const apiClient = new Misskey.api.APIClient({
// #v-ifdef VITE_CAPACITOR // #v-ifdef VITE_CAPACITOR
origin: $i?.instanceUrl || url || window.location.origin, origin: $i?.instanceUrl || window.location.origin,
// #v-else // #v-else
origin: url, origin: url,
// #v-endif // #v-endif