Skip to content

Commit 2d44d17

Browse files
authored
fix: wrong unread count issue in the SampleApp (#1728)
1 parent ed05ebc commit 2d44d17

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

examples/SampleApp/src/components/UnreadCountBadge.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ export const UnreadCountBadge: React.FC = () => {
3131
const [count, setCount] = useState<number>();
3232

3333
useEffect(() => {
34-
const user = chatClient?.user;
35-
const unreadCount = isOwnUser(user) ? user.total_unread_count : undefined;
36-
setCount(unreadCount);
3734
const listener = chatClient?.on((e) => {
38-
if (e.total_unread_count) {
35+
if (e.total_unread_count !== undefined) {
3936
setCount(e.total_unread_count);
4037
}
4138
});

0 commit comments

Comments
 (0)