This commit is contained in:
Matt Hill
2021-07-06 16:56:39 -06:00
committed by Aiden McClelland
parent b7bd147c76
commit 0c6a0218a6
12 changed files with 79 additions and 68 deletions

View File

@@ -84,8 +84,6 @@ export class AppComponent {
this.http.authReqEnabled = true
this.showMenu = true
this.patch.start()
// watch patch DB to display name and unread count
this.watchPatch()
this.connectionService.start()
// watch connection to display connectivity issues
this.watchConnection(auth)
@@ -111,13 +109,6 @@ export class AppComponent {
})
}
watchPatch (): void {
this.patch.watch$('server-info', 'unread-notification-count')
.subscribe(unread => {
this.unreadCount = unread
})
}
private watchConnection (auth: AuthState): void {
this.connectionService.watchFailure$()
.pipe(
@@ -194,6 +185,7 @@ export class AppComponent {
finalize(() => console.log('FINALIZING!!!')),
)
.subscribe(count => {
this.unreadCount = count
if (previous !== undefined && count > previous) this.presentToastNotifications()
previous = count
})