Skip to content

Commit

Permalink
Remove Redudant TTS button from button group (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpatel292-seneca authored Nov 22, 2024
1 parent 2b698ee commit 1420fd8
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions src/components/PromptForm/PromptSendButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ type PromptSendButtonProps = {
function MobilePromptSendButton({ isLoading }: PromptSendButtonProps) {
const { settings, setSettings } = useSettings();
const { models } = useModels();
const { clearAudioQueue, isAudioQueueEmpty } = useAudioPlayer();
const { isTextToSpeechSupported } = useTextToSpeech();
return (
<ButtonGroup variant="outline" isAttached>
<IconButton
Expand All @@ -33,48 +31,6 @@ function MobilePromptSendButton({ isLoading }: PromptSendButtonProps) {
isLoading={isLoading}
icon={<TbSend />}
/>
{isTextToSpeechSupported && isAudioQueueEmpty ? (
<Tooltip
label={
settings.textToSpeech.announceMessages
? "Text-to-Speech Enabled"
: "Text-to-Speech Disabled"
}
>
<IconButton
type="button"
size="md"
variant="solid"
aria-label={
settings.textToSpeech.announceMessages
? "Text-to-Speech Enabled"
: "Text-to-Speech Disabled"
}
icon={
settings.textToSpeech.announceMessages ? (
<MdVolumeUp size={25} />
) : (
<MdVolumeOff size={25} />
)
}
onClick={() => {
if (settings.textToSpeech.announceMessages) {
// Flush any remaining audio clips being announced
clearAudioQueue();
}
setSettings({
...settings,
textToSpeech: {
...settings.textToSpeech,
announceMessages: !settings.textToSpeech.announceMessages,
},
});
}}
/>
</Tooltip>
) : isTextToSpeechSupported ? (
<InterruptSpeechButton variant={"dancingBars"} size={"lg"} clearOnly={!isLoading} />
) : null}
<Menu
position="anchor"
align="center"
Expand Down

0 comments on commit 1420fd8

Please sign in to comment.