fix(frontend): 画面を閉じる直前にAudioContextを閉じるように

This commit is contained in:
kakkokari-gtyih 2024-12-01 11:14:45 +09:00
parent dac3b1f405
commit 62f82b46c9

View file

@ -93,6 +93,10 @@ export async function loadAudio(url: string, options?: { useCache?: boolean; })
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (ctx == null) {
ctx = new AudioContext();
window.addEventListener('beforeunload', () => {
ctx.close();
});
}
if (options?.useCache ?? true) {
if (cache.has(url)) {