Skip to content

Commit e4f287e

Browse files
committed
fix(notifications): check unreadPrivateMessages on user object
While previously we just verify the number of unreadNotifications there is also a property of unreadPrivateMessages on user object that refers to notifications for messages (duh). This code will look for that in order to decide whether or not send a request to gather notifications data.
1 parent 54cd18b commit e4f287e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/notifications/Notifications.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ export class Notifications extends React.Component<Props, State> {
4242
}
4343

4444
async updateUserNotifications() {
45-
const { unread_notifications: unreadNotifications } = this.props.user;
45+
const {
46+
unread_notifications: unreadNotifications,
47+
unread_private_messages: unreadPrivateMessages,
48+
} = this.props.user;
4649

47-
if (unreadNotifications > 0) {
50+
if (unreadNotifications > 0 || unreadPrivateMessages > 0) {
4851
const notifications = await this.props.service.getNotifications();
4952
const normalisedNotifications = normaliseUserNotifications(notifications);
5053

0 commit comments

Comments
 (0)