Skip to content

Commit fd28421

Browse files
committed
perf: exit early when setting typing state
1 parent 09d9b3c commit fd28421

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

package/src/components/Channel/Channel.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ const ChannelWithContext = <
784784
const isTypingEvent = event.type === 'typing.start' || event.type === 'typing.stop';
785785
if (isTypingEvent) {
786786
setTyping(channel);
787+
return;
787788
} else {
788789
if (thread?.id) {
789790
const updatedThreadMessages =
@@ -817,6 +818,7 @@ const ChannelWithContext = <
817818

818819
// only update channel state if the events are not the previously subscribed useEffect's subscription events
819820
if (channel && channel.initialized) {
821+
console.log('COPYING CHANNEL STATE LOL');
820822
copyChannelState();
821823
}
822824
}

0 commit comments

Comments
 (0)