Skip to content

Commit da1b5c3

Browse files
committed
fix: dep update
1 parent f8f1208 commit da1b5c3

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

package/src/components/Channel/Channel.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -877,18 +877,14 @@ const ChannelWithContext = <
877877
/**
878878
* Subscription to the Notification mark_read event.
879879
*/
880-
useEffect(
881-
() => {
882-
const handleEvent: EventHandler<StreamChatGenerics> = (event) => {
883-
if (channel.cid === event.cid) setRead(channel);
884-
};
880+
useEffect(() => {
881+
const handleEvent: EventHandler<StreamChatGenerics> = (event) => {
882+
if (channel.cid === event.cid) setRead(channel);
883+
};
885884

886-
const { unsubscribe } = client.on('notification.mark_read', handleEvent);
887-
return unsubscribe;
888-
},
889-
// eslint-disable-next-line react-hooks/exhaustive-deps
890-
[channel, client, setRead],
891-
);
885+
const { unsubscribe } = client.on('notification.mark_read', handleEvent);
886+
return unsubscribe;
887+
}, [channel, client, setRead]);
892888

893889
const threadPropsExists = !!threadProps;
894890

0 commit comments

Comments
 (0)