From 783c615a0c5126c2f1f87e97dfe057ed15efdf19 Mon Sep 17 00:00:00 2001 From: Martin <901824+martinstark@users.noreply.github.com> Date: Fri, 26 Apr 2024 09:43:47 +0200 Subject: [PATCH] fix: enable press to talk button use same cb for hotkey and press to talk button --- .../production-line/long-press-to-talk-button.tsx | 8 ++++---- src/components/production-line/production-line.tsx | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/production-line/long-press-to-talk-button.tsx b/src/components/production-line/long-press-to-talk-button.tsx index cda4af58..6144a1ea 100644 --- a/src/components/production-line/long-press-to-talk-button.tsx +++ b/src/components/production-line/long-press-to-talk-button.tsx @@ -4,7 +4,7 @@ import { PrimaryButton } from "../landing-page/form-elements"; import { isMobile } from "../../bowser"; type TLongPressToTalkButton = { - setMicMute: (input: boolean) => void; + muteInput: (input: boolean) => void; }; const Button = styled(PrimaryButton)` @@ -31,7 +31,7 @@ const Button = styled(PrimaryButton)` `; export const LongPressToTalkButton = ({ - setMicMute, + muteInput, }: TLongPressToTalkButton) => { const [isToggled, setIsToggled] = useState(false); const [longPressTimeout, setLongPressTimeout] = @@ -55,14 +55,14 @@ export const LongPressToTalkButton = ({ switch (e.type) { case "pointerdown": timeoutId = setTimeout(() => { - setMicMute(false); + muteInput(false); setIsToggled(true); }, 300); setLongPressTimeout(timeoutId); break; case "pointerup": setIsToggled(false); - setMicMute(true); + muteInput(true); clearTimeout(longPressTimeout); break; default: diff --git a/src/components/production-line/production-line.tsx b/src/components/production-line/production-line.tsx index ddbf5130..caf3a66f 100644 --- a/src/components/production-line/production-line.tsx +++ b/src/components/production-line/production-line.tsx @@ -238,9 +238,7 @@ export const ProductionLine: FC = () => { {inputAudioStream && inputAudioStream !== "no-device" && ( - setIsInputMuted(input)} - /> + )}