|
@@ -1512,6 +1512,7 @@ export class WebClientService implements threema.WebClientService {
|
|
|
this.conversations.updateOrAdd(conversation);
|
|
|
}
|
|
|
}
|
|
|
+ this.updateUnreadCount();
|
|
|
this.registerInitializationStep('conversations');
|
|
|
}
|
|
|
|
|
@@ -1573,11 +1574,7 @@ export class WebClientService implements threema.WebClientService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // Update unread count
|
|
|
- const totalUnreadCount = this.conversations
|
|
|
- .get()
|
|
|
- .reduce((a: number, b: threema.Conversation) => a + b.unreadCount, 0);
|
|
|
- this.titleService.updateUnreadCount(totalUnreadCount);
|
|
|
+ this.updateUnreadCount();
|
|
|
}
|
|
|
|
|
|
private _receiveResponseMessages(message: threema.WireMessage): void {
|
|
@@ -2343,4 +2340,14 @@ export class WebClientService implements threema.WebClientService {
|
|
|
public getControllerName(): string {
|
|
|
return this.currentController;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Update the unread count in the window title.
|
|
|
+ */
|
|
|
+ private updateUnreadCount(): void {
|
|
|
+ const totalUnreadCount = this.conversations
|
|
|
+ .get()
|
|
|
+ .reduce((a: number, b: threema.Conversation) => a + b.unreadCount, 0);
|
|
|
+ this.titleService.updateUnreadCount(totalUnreadCount);
|
|
|
+ }
|
|
|
}
|