mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-28 14:30:39 +01:00
fix(frontend): 画面を閉じる直前にAudioContextを閉じるように
This commit is contained in:
parent
dac3b1f405
commit
62f82b46c9
1 changed files with 4 additions and 0 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue