From 20c0453b9f13cec6cc05b51693f998c27f11004c Mon Sep 17 00:00:00 2001 From: William Grant Date: Mon, 6 May 2024 16:18:54 +1000 Subject: [PATCH] fix: dont disable text area for outgoing message requests we only want to disable some of the buttons --- .../conversation/composition/CompositionButtons.tsx | 12 ++---------- .../conversation/composition/CompositionTextArea.tsx | 4 +--- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/ts/components/conversation/composition/CompositionButtons.tsx b/ts/components/conversation/composition/CompositionButtons.tsx index 565a6d209..00af99e9d 100644 --- a/ts/components/conversation/composition/CompositionButtons.tsx +++ b/ts/components/conversation/composition/CompositionButtons.tsx @@ -63,11 +63,8 @@ export const StartRecordingButton = (props: { onClick: () => void }) => { // eslint-disable-next-line react/display-name export const ToggleEmojiButton = forwardRef void }>( (props, ref) => { - const selectedConvoKey = useSelectedConversationKey(); - const isOutgoingRequest = useIsOutgoingRequest(selectedConvoKey); - return ( - + borderRadius="300px" iconPadding="6px" onClick={props.onClick} - disabled={isOutgoingRequest} dataTestId="emoji-button" /> @@ -86,11 +82,8 @@ export const ToggleEmojiButton = forwardRef ); export const SendMessageButton = (props: { onClick: () => void }) => { - const selectedConvoKey = useSelectedConversationKey(); - const isOutgoingRequest = useIsOutgoingRequest(selectedConvoKey); - return ( - + void }) => { borderRadius="300px" iconPadding="6px" onClick={props.onClick} - disabled={isOutgoingRequest} dataTestId="send-message-button" /> diff --git a/ts/components/conversation/composition/CompositionTextArea.tsx b/ts/components/conversation/composition/CompositionTextArea.tsx index e1a64c70d..6c8a1a1b5 100644 --- a/ts/components/conversation/composition/CompositionTextArea.tsx +++ b/ts/components/conversation/composition/CompositionTextArea.tsx @@ -1,6 +1,5 @@ import { RefObject, useState } from 'react'; import { Mention, MentionsInput } from 'react-mentions'; -import { useIsOutgoingRequest } from '../../../hooks/useParamSelector'; import { getConversationController } from '../../../session/conversations'; import { useSelectedConversationKey, @@ -55,7 +54,6 @@ export const CompositionTextArea = (props: Props) => { const selectedConversationKey = useSelectedConversationKey(); const htmlDirection = useHTMLDirection(); - const isOutgoingRequest = useIsOutgoingRequest(selectedConversationKey); const isKickedFromGroup = useSelectedIsKickedFromGroup(); const left = useSelectedIsLeft(); const isBlocked = useSelectedIsBlocked(); @@ -121,7 +119,7 @@ export const CompositionTextArea = (props: Props) => { spellCheck={true} dir={htmlDirection} inputRef={textAreaRef} - disabled={!typingEnabled || isOutgoingRequest} + disabled={!typingEnabled} rows={1} data-testid="message-input-text-area" style={style}