feat(voice): add setMuted() idempotent setter and pttActive state for PTT keybinds
This commit is contained in:
@@ -79,6 +79,9 @@ interface VoiceState {
|
||||
setOutputVolume: (volume: number) => void;
|
||||
setInputDevice: (deviceId: string) => void;
|
||||
setOutputDevice: (deviceId: string) => void;
|
||||
pttActive: boolean;
|
||||
setMuted: (muted: boolean) => void;
|
||||
setPttActive: (active: boolean) => void;
|
||||
toggleMic: () => void;
|
||||
toggleCamera: () => void;
|
||||
toggleScreenShare: () => void;
|
||||
@@ -122,6 +125,7 @@ export const useVoiceStore = create<VoiceState>()(
|
||||
voiceUsers: new Map(),
|
||||
currentVoiceChannelId: null,
|
||||
isMuted: false,
|
||||
pttActive: false,
|
||||
isDeafened: false,
|
||||
isCameraOn: false,
|
||||
isScreenSharing: false,
|
||||
@@ -290,6 +294,9 @@ export const useVoiceStore = create<VoiceState>()(
|
||||
|
||||
setOutputDevice: (deviceId) => set({ outputDeviceId: deviceId }),
|
||||
|
||||
setMuted: (muted: boolean) => set({ isMuted: muted }),
|
||||
setPttActive: (active: boolean) => set({ pttActive: active }),
|
||||
|
||||
toggleMic: () => set((state) => {
|
||||
// User intent toggle — effective state (intent || serverEnforcement) is
|
||||
// computed at broadcast/hardware time, so the mic stays off while server-muted
|
||||
|
||||
Reference in New Issue
Block a user