summaryrefslogtreecommitdiffstats
path: root/ui/src/components/navbar.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-02-11 10:14:09 -0500
committerDessalines <tyhou13@gmx.com>2020-02-11 10:14:09 -0500
commit774518e4fe336ac60c6e8ccdbc9a98e0cb8b9310 (patch)
treee210171524334915a06e6baa03ac2f569b42efda /ui/src/components/navbar.tsx
parentf1392dc9a7beebcb86d7109a2b408344c2abcecc (diff)
Fixing unread indicator on link click. Fixes #527
Diffstat (limited to 'ui/src/components/navbar.tsx')
-rw-r--r--ui/src/components/navbar.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/src/components/navbar.tsx b/ui/src/components/navbar.tsx
index c675cfe7..75cdd554 100644
--- a/ui/src/components/navbar.tsx
+++ b/ui/src/components/navbar.tsx
@@ -60,8 +60,10 @@ export class Navbar extends Component<any, NavbarState> {
// Subscribe to user changes
this.userSub = UserService.Instance.sub.subscribe(user => {
this.state.isLoggedIn = user.user !== undefined;
- this.state.unreadCount = user.unreadCount;
- this.requestNotificationPermission();
+ if (this.state.isLoggedIn) {
+ this.state.unreadCount = user.user.unreadCount;
+ this.requestNotificationPermission();
+ }
this.setState(this.state);
});
@@ -304,9 +306,9 @@ export class Navbar extends Component<any, NavbarState> {
}
sendUnreadCount() {
+ UserService.Instance.user.unreadCount = this.state.unreadCount;
UserService.Instance.sub.next({
user: UserService.Instance.user,
- unreadCount: this.state.unreadCount,
});
}