fix: re-apply desired device state after EC joins, support mid-call PTT

This commit is contained in:
root
2026-05-14 19:14:29 -04:00
parent c37220eb21
commit 69091bc055
3 changed files with 19 additions and 0 deletions
+9
View File
@@ -58,6 +58,15 @@ export function CallControls({ callEmbed }: CallControlsProps) {
const [pttKey] = useSetting(settingsAtom, 'pttKey');
const [pttActive, setPttActive] = useState(false);
// Mute mic immediately when PTT is enabled mid-call so the key handler can activate
const pttModeRef = useRef(pttMode);
useEffect(() => {
if (pttMode && !pttModeRef.current && microphone) {
callEmbed.control.setMicrophone(false);
}
pttModeRef.current = pttMode;
}, [pttMode, callEmbed, microphone]);
const handleOpenMenu: MouseEventHandler<HTMLButtonElement> = (evt) => {
setCords(evt.currentTarget.getBoundingClientRect());
};