diff --git a/src/shared/components/app/navbar.tsx b/src/shared/components/app/navbar.tsx index 448e92cb..049cd399 100644 --- a/src/shared/components/app/navbar.tsx +++ b/src/shared/components/app/navbar.tsx @@ -508,11 +508,14 @@ export class Navbar extends Component { this.sendUnreadCount(); } else if (op == UserOperation.GetReportCount) { let data = wsJsonToRes(msg); + + let count = data.post_reports + data.comment_reports; + // This is frustrating, but data.private_message_reports ?? 0 doesn't work in the browser + if (data.private_message_reports !== undefined) { + count += data.private_message_reports; + } this.setState({ - unreadReportCount: - data.post_reports + - data.comment_reports + - (data.private_message_reports ?? 0n), + unreadReportCount: count, }); this.sendReportUnread(); } else if (op == UserOperation.GetUnreadRegistrationApplicationCount) {