fix(frontend): userActivationがない環境において不具合が生じる問題を修正 (#13451)

This commit is contained in:
zyoshoka 2024-02-24 18:06:10 +09:00 committed by GitHub
parent 41747b6ee2
commit 792168fdfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -126,7 +126,7 @@ export async function loadAudio(url: string, options?: { useCache?: boolean; })
*/ */
export function playMisskeySfx(operationType: OperationType) { export function playMisskeySfx(operationType: OperationType) {
const sound = defaultStore.state[`sound_${operationType}`]; const sound = defaultStore.state[`sound_${operationType}`];
if (sound.type == null || !canPlay || !navigator.userActivation.hasBeenActive) return; if (sound.type == null || !canPlay || ('userActivation' in navigator && !navigator.userActivation.hasBeenActive)) return;
canPlay = false; canPlay = false;
playMisskeySfxFile(sound).finally(() => { playMisskeySfxFile(sound).finally(() => {