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

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

* Update Changelog

* Update CHANGELOG.md

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
かっこかり
2025-01-26 15:07:12 +09:00
committed by GitHub
parent ef29130057
commit 791b4500ec
2 changed files with 5 additions and 0 deletions

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)) {