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("lang", lang);
localStorage.setItem("locale", await lang_res.text()); localStorage.setItem("locale", await lang_res.text());
localStorage.setItem("localeVersion", version); localStorage.setItem("localeVersion", version);
document.location.href = '/';
} }
} }

View File

@ -1,3 +1,4 @@
import { url } from "@/config";
import { ColdDeviceStorage } from "@/store"; import { ColdDeviceStorage } from "@/store";
const cache = new Map<string, HTMLAudioElement>(); const cache = new Map<string, HTMLAudioElement>();
@ -7,7 +8,7 @@ export function getAudio(file: string, useCache = true): HTMLAudioElement {
if (useCache && cache.has(file)) { if (useCache && cache.has(file)) {
audio = cache.get(file); audio = cache.get(file);
} else { } else {
audio = new Audio(`/static-assets/sounds/${file}.mp3`); audio = new Audio(`${url}+/static-assets/sounds/${file}.mp3`);
if (useCache) cache.set(file, audio); if (useCache) cache.set(file, audio);
} }
return 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 { export function char2fileName(char: string): string {
let codes = Array.from(char).map((x) => x.codePointAt(0)?.toString(16)); 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 { I18n } from "@/scripts/i18n";
import { getAccountFromId } from "@/scripts/get-account-from-id"; import { getAccountFromId } from "@/scripts/get-account-from-id";
import { char2fileName } from "@/scripts/twemoji-base"; import { char2fileName } from "@/scripts/twemoji-base";
import * as url from "@/scripts/url"; import * as urlObject from "@/scripts/url";
const iconUrl = (name: string) => const iconUrl = (name: string) =>
`/static-assets/notification-badges/${name}.png`; `/static-assets/notification-badges/${name}.png`;
@ -178,7 +178,7 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(
badge = u.href; badge = u.href;
} else { } else {
const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので const dummy = `${u.host}${u.pathname}`; // 拡張子がないとキャッシュしてくれないCDNがあるので
badge = `${origin}/proxy/${dummy}?${url.query({ badge = `${origin}/proxy/${dummy}?${urlObject.query({
url: u.href, url: u.href,
badge: "1", badge: "1",
})}`; })}`;