Skip to content

Commit ac17cf2

Browse files
committed
fix: disable typing events when offline
1 parent 0a4c852 commit ac17cf2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package/src/contexts/messageInputContext/MessageInputContext.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,8 @@ export const MessageInputProvider = <
538538
setSelectedImages,
539539
setSelectedPicker,
540540
} = useAttachmentPickerContext();
541-
const { appSettings, client, enableOfflineSupport } = useChatContext<StreamChatGenerics>();
541+
const { appSettings, client, enableOfflineSupport, isOnline } =
542+
useChatContext<StreamChatGenerics>();
542543
const { removeMessage } = useMessagesContext();
543544

544545
const getFileUploadConfig = () => {
@@ -652,7 +653,7 @@ export const MessageInputProvider = <
652653
}
653654
setText(newText);
654655

655-
if (newText && channel && channelCapabities.sendTypingEvents) {
656+
if (newText && channel && channelCapabities.sendTypingEvents && isOnline) {
656657
logChatPromiseExecution(channel.keystroke(thread?.id), 'start typing event');
657658
}
658659

package/src/contexts/messageInputContext/hooks/useCreateMessageInputContext.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ export const useCreateMessageInputContext = <
258258
text,
259259
threadId,
260260
showPollCreationDialog,
261+
onChange,
261262
],
262263
);
263264

0 commit comments

Comments
 (0)