feat(sounds): add messageSoundAllChannels preference to voiceStore

This commit is contained in:
Jannis Braun
2026-04-28 14:26:41 +02:00
parent 00daa14dcd
commit a3bd0313a8
+5
View File
@@ -49,6 +49,8 @@ interface VoiceState {
unwatchedCameras: Set<string>; // userIds whose cameras we've opted out of unwatchedCameras: Set<string>; // userIds whose cameras we've opted out of
soundEffectVolume: number; // 0-200 (100 = default) soundEffectVolume: number; // 0-200 (100 = default)
setSoundEffectVolume: (volume: number) => void; setSoundEffectVolume: (volume: number) => void;
messageSoundAllChannels: boolean; // false (default) = DM + mention only; true = every channel
setMessageSoundAllChannels: (allChannels: boolean) => void;
streamAttenuationEnabled: boolean; // global toggle, default true streamAttenuationEnabled: boolean; // global toggle, default true
streamAttenuationStrength: number; // 0-100, default 50 streamAttenuationStrength: number; // 0-100, default 50
setStreamVolume: (userId: string, volume: number) => void; setStreamVolume: (userId: string, volume: number) => void;
@@ -181,6 +183,8 @@ export const useVoiceStore = create<VoiceState>()(
soundEffectVolume: 100, soundEffectVolume: 100,
setSoundEffectVolume: (volume) => set({ soundEffectVolume: volume }), setSoundEffectVolume: (volume) => set({ soundEffectVolume: volume }),
messageSoundAllChannels: false,
setMessageSoundAllChannels: (allChannels) => set({ messageSoundAllChannels: allChannels }),
// Stream widget state // Stream widget state
streamVolumes: new Map(), streamVolumes: new Map(),
@@ -704,6 +708,7 @@ export const useVoiceStore = create<VoiceState>()(
autoGainControl: state.autoGainControl, autoGainControl: state.autoGainControl,
rnnoiseEnabled: state.rnnoiseEnabled, rnnoiseEnabled: state.rnnoiseEnabled,
soundEffectVolume: state.soundEffectVolume, soundEffectVolume: state.soundEffectVolume,
messageSoundAllChannels: state.messageSoundAllChannels,
streamAttenuationEnabled: state.streamAttenuationEnabled, streamAttenuationEnabled: state.streamAttenuationEnabled,
streamAttenuationStrength: state.streamAttenuationStrength, streamAttenuationStrength: state.streamAttenuationStrength,
// Per-user preferences (Map → plain object for JSON) // Per-user preferences (Map → plain object for JSON)