Skip to content

Commit

Permalink
fix: removed unused prop and fixed reset textarea focus logic
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepat0 committed Nov 13, 2024
1 parent c62de47 commit b5ff368
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export interface Props {
onChangeUserMessage: (userMessage: string) => void;
sendMessage: (msg: string) => void;
listening?: boolean;
enableFocusChatInput?: boolean;
setEnableFocusChatInput: (enableFocusChatInput: boolean) => void;
isPlayingAudio?: boolean;
stopAudio: () => void;
Expand Down Expand Up @@ -106,7 +105,6 @@ const Chat: React.FC<Props> = ({
onChangeUserMessage,
sendMessage,
listening,
enableFocusChatInput = true,
setEnableFocusChatInput,
isPlayingAudio,
stopAudio,
Expand Down Expand Up @@ -134,12 +132,11 @@ const Chat: React.FC<Props> = ({

const onTextareaFocus = () => {
stopListening();
// if the user is on mobile and had not recorded audio, add the chat-focused class to the chat wrapper
if (hasTouchscreen() && window.innerWidth <= 768) {
const hasTouch = hasTouchscreen();

if (enableFocusChatInput === false) {
setEnableFocusChatInput(true);
}
if (hasTouch) setEnableFocusChatInput(true);
// if the user is on mobile and had not recorded audio, add the chat-focused class to the chat wrapper
if (hasTouch && window.innerWidth <= 768) {
document.getElementById('chat-wrapper')?.classList?.add('chat-focused');
// add the chat-focused class to the memori widget
document
Expand Down
1 change: 0 additions & 1 deletion src/components/MemoriWidget/MemoriWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3179,7 +3179,6 @@ const MemoriWidget = ({
stopAudio,
resetTranscript,
listening,
enableFocusChatInput,
setEnableFocusChatInput,
isPlayingAudio,
customMediaRenderer,
Expand Down

0 comments on commit b5ff368

Please sign in to comment.