fix stuff?

This commit is contained in:
cutestnekoaqua 2023-04-08 17:35:29 +02:00
parent 92cb05cc9a
commit 1ca221ffc2
No known key found for this signature in database
GPG Key ID: 6BF0964A5069C1E0
4 changed files with 8 additions and 4 deletions

View File

@ -24,6 +24,7 @@ const res = await Device.getInfo();
localStorage.setItem("lang", lang);
localStorage.setItem("locale", await lang_res.text());
localStorage.setItem("localeVersion", version);
document.location.href = '/';
}
}

View File

@ -1,3 +1,4 @@
import { url } from "@/config";
import { ColdDeviceStorage } from "@/store";
const cache = new Map<string, HTMLAudioElement>();
@ -7,7 +8,7 @@ export function getAudio(file: string, useCache = true): HTMLAudioElement {
if (useCache && cache.has(file)) {
audio = cache.get(file);
} else {
audio = new Audio(`/static-assets/sounds/${file}.mp3`);
audio = new Audio(`${url}+/static-assets/sounds/${file}.mp3`);
if (useCache) cache.set(file, audio);
}
return audio;

View File

@ -1,4 +1,6 @@
export const twemojiSvgBase = "/twemoji";
import { url } from "@/config";
export const twemojiSvgBase = `${url}/twemoji`;
export function char2fileName(char: string): string {
let codes = Array.from(char).map((x) => x.codePointAt(0)?.toString(16));

View File

@ -10,7 +10,7 @@ import getUserName from "@/scripts/get-user-name";
import { I18n } from "@/scripts/i18n";
import { getAccountFromId } from "@/scripts/get-account-from-id";
import { char2fileName } from "@/scripts/twemoji-base";
import * as url from "@/scripts/url";
import * as urlObject from "@/scripts/url";
const iconUrl = (name: string) =>
`/static-assets/notification-badges/${name}.png`;
@ -178,7 +178,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(
badge = u.href;
} else {
const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので
badge = `${origin}/proxy/${dummy}?${url.query({
badge = `${origin}/proxy/${dummy}?${urlObject.query({
url: u.href,
badge: "1",
})}`;