We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed05ebc commit 2d44d17Copy full SHA for 2d44d17
examples/SampleApp/src/components/UnreadCountBadge.tsx
@@ -31,11 +31,8 @@ export const UnreadCountBadge: React.FC = () => {
31
const [count, setCount] = useState<number>();
32
33
useEffect(() => {
34
- const user = chatClient?.user;
35
- const unreadCount = isOwnUser(user) ? user.total_unread_count : undefined;
36
- setCount(unreadCount);
37
const listener = chatClient?.on((e) => {
38
- if (e.total_unread_count) {
+ if (e.total_unread_count !== undefined) {
39
setCount(e.total_unread_count);
40
}
41
});
0 commit comments