mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-01 16:51:13 +00:00
Fix strange navbar bigint issue.
This commit is contained in:
parent
d56d20d0be
commit
62efb876af
1 changed files with 7 additions and 4 deletions
|
@ -508,11 +508,14 @@ export class Navbar extends Component<NavbarProps, NavbarState> {
|
|||
this.sendUnreadCount();
|
||||
} else if (op == UserOperation.GetReportCount) {
|
||||
let data = wsJsonToRes<GetReportCountResponse>(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) {
|
||||
|
|
Loading…
Reference in a new issue