enhance(frontend): 設定の同期をオンにするときに競合したときに値をマージできるように

This commit is contained in:
syuilo
2025-05-31 12:49:10 +09:00
parent 9f196bbf75
commit 0254570fbf
8 changed files with 85 additions and 28 deletions

View File

@@ -6,6 +6,7 @@
import type { SoundStore } from '@/preferences/def.js';
import { prefer } from '@/preferences.js';
import { PREF_DEF } from '@/preferences/def.js';
import { getInitialPrefValue } from '@/preferences/manager.js';
let ctx: AudioContext;
const cache = new Map<string, AudioBuffer>();
@@ -133,7 +134,8 @@ export function playMisskeySfx(operationType: OperationType) {
playMisskeySfxFile(sound).then((succeed) => {
if (!succeed && sound.type === '_driveFile_') {
// ドライブファイルが存在しない場合はデフォルトのサウンドを再生する
const soundName = PREF_DEF[`sound.on.${operationType}`].default.type as Exclude<SoundType, '_driveFile_'>;
const default_ = getInitialPrefValue(`sound.on.${operationType}`);
const soundName = default_.type as Exclude<SoundType, '_driveFile_'>;
if (_DEV_) console.log(`Failed to play sound: ${sound.fileUrl}, so play default sound: ${soundName}`);
playMisskeySfxFileInternal({
type: soundName,