From 063d73cff105bcb90cf32349a5715ad6c718a9ca Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Sun, 22 Mar 2026 20:23:23 +0100 Subject: [PATCH] feat(voice): add setMuted() idempotent setter and pttActive state for PTT keybinds --- packages/web/src/stores/voiceStore.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/web/src/stores/voiceStore.ts b/packages/web/src/stores/voiceStore.ts index 183fa172..2aef5805 100644 --- a/packages/web/src/stores/voiceStore.ts +++ b/packages/web/src/stores/voiceStore.ts @@ -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()( voiceUsers: new Map(), currentVoiceChannelId: null, isMuted: false, + pttActive: false, isDeafened: false, isCameraOn: false, isScreenSharing: false, @@ -290,6 +294,9 @@ export const useVoiceStore = create()( 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