Skip to content

Commit b03e78c

Browse files
committed
perf: remove ref clearing
1 parent 3dcc085 commit b03e78c

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

package/src/components/MessageInput/MessageInput.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -860,18 +860,17 @@ const MessageInputWithContext = <
860860

861861
{shouldDisplayStopAIGeneration ? (
862862
<StopMessageStreamingButton onPress={stopGenerating} />
863-
) : (
864-
isSendingButtonVisible() &&
865-
(cooldownRemainingSeconds ? (
863+
) : isSendingButtonVisible() ? (
864+
cooldownRemainingSeconds ? (
866865
<CooldownTimer seconds={cooldownRemainingSeconds} />
867866
) : (
868867
<View style={[styles.sendButtonContainer, sendButtonContainer]}>
869868
<SendButton
870869
disabled={sending.current || !isValidMessage() || (giphyActive && !isOnline)}
871870
/>
872871
</View>
873-
))
874-
)}
872+
)
873+
) : null}
875874
{audioRecordingEnabled && isAudioRecorderAvailable() && !micLocked && (
876875
<GestureDetector gesture={panGestureMic}>
877876
<Animated.View

package/src/contexts/messageInputContext/MessageInputContext.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -952,10 +952,6 @@ export const MessageInputProvider = <
952952
const prevText = giphyEnabled && giphyActive ? `/giphy ${text}` : text;
953953
setText('');
954954

955-
if (inputBoxRef.current) {
956-
inputBoxRef.current.clear();
957-
}
958-
959955
const attachments = [] as Attachment<StreamChatGenerics>[];
960956
for (const image of imageUploads) {
961957
if (enableOfflineSupport) {

0 commit comments

Comments
 (0)