diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b35034cc819ee7669dfb4cae89b42c6ae851ad4..c2e9c8e258d0b1b728f97a9542d064223ed01c30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ - Fix: リアクションã—ãŸãƒ¦ãƒ¼ã‚¶ãƒ¼ä¸€è¦§ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼åãŒã¯ã¿å‡ºã‚‹å•é¡Œã‚’ä¿®æ£ (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/672) - Fix: `/share`ページã«ãŠã„ã¦çµµæ–‡å—ピッカーを開ãã“ã¨ãŒã§ããªã„å•é¡Œã‚’ä¿®æ£ +- Fix: deck uiã®é€šçŸ¥éŸ³ãŒé‡ãªã‚‹å•é¡Œ (#14029) - Fix: ダイレクト投稿ã®"削除ã—ã¦ç·¨é›†"ã«ãŠã„ã¦ã€å®›å…ˆãŒä¿æŒã•ã‚Œã¦ã„ãªã‹ã£ãŸå•é¡Œã‚’ä¿®æ£ - Fix: 投稿フォームã¸ã®URL貼り付ã‘ã«ã‚ˆã‚‹å¼•ç”¨ãŒä¸‹æ›¸ãã«ä¿å˜ã•ã‚Œã¦ã„ãªã‹ã£ãŸå•é¡Œã‚’ä¿®æ£ - Fix: "削除ã—ã¦ç·¨é›†"や下書ãã«ãŠã„ã¦ã€ãƒªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã®å—ã‘入れè¨å®šãŒä¿æŒ/ä¿å˜ã•ã‚Œã¦ã„ãªã‹ã£ãŸå•é¡Œã‚’ä¿®æ£ diff --git a/packages/frontend/src/scripts/sound.ts b/packages/frontend/src/scripts/sound.ts index bba855cd6437165f74160453ca865c30cfe92c9f..814e0808115e1b627c2d790d94d88f350c5be4aa 100644 --- a/packages/frontend/src/scripts/sound.ts +++ b/packages/frontend/src/scripts/sound.ts @@ -124,10 +124,23 @@ export async function loadAudio(url: string, options?: { useCache?: boolean; }) */ export function playMisskeySfx(operationType: OperationType) { const sound = defaultStore.state[`sound_${operationType}`]; - if (sound.type == null || !canPlay || ('userActivation' in navigator && !navigator.userActivation.hasBeenActive)) return; + playMisskeySfxFile(sound); +} + +/** + * サウンドè¨å®šå½¢å¼ã§æŒ‡å®šã•ã‚ŒãŸéŸ³å£°ã‚’å†ç”Ÿã™ã‚‹ + * @param soundStore サウンドè¨å®š + */ +export function playMisskeySfxFile(soundStore: SoundStore) { + // 連続ã—ã¦å†ç”Ÿã—ãªã„ + if (!canPlay) return; + // ユーザーアクティベーションãŒå¿…è¦ãªå ´åˆã¯ãã‚ŒãŒãªã„å ´åˆã¯å†ç”Ÿã—ãªã„ + if ('userActivation' in navigator && !navigator.userActivation.hasBeenActive) return; + // サウンドãŒãªã„å ´åˆã¯å†ç”Ÿã—ãªã„ + if (soundStore.type === null || soundStore.type === '_driveFile_' && !soundStore.fileUrl) return; canPlay = false; - playMisskeySfxFile(sound).finally(() => { + playMisskeySfxFileInternal(soundStore).finally(() => { // ã”ãçŸæ™‚é–“ã«éŸ³ãŒé‡è¤‡ã—ãªã„よã†ã« setTimeout(() => { canPlay = true; @@ -135,11 +148,7 @@ export function playMisskeySfx(operationType: OperationType) { }); } -/** - * サウンドè¨å®šå½¢å¼ã§æŒ‡å®šã•ã‚ŒãŸéŸ³å£°ã‚’å†ç”Ÿã™ã‚‹ - * @param soundStore サウンドè¨å®š - */ -export async function playMisskeySfxFile(soundStore: SoundStore) { +async function playMisskeySfxFileInternal(soundStore: SoundStore) { if (soundStore.type === null || (soundStore.type === '_driveFile_' && !soundStore.fileUrl)) { return; }