Pārlūkot izejas kodu

Reset unread count after logout (#149)

Fixes #148
IndianaDschones 8 gadi atpakaļ
vecāks
revīzija
5c436ccf82
1 mainītis faili ar 10 papildinājumiem un 0 dzēšanām
  1. 10 0
      src/services/webclient.ts

+ 10 - 0
src/services/webclient.ts

@@ -531,6 +531,9 @@ export class WebClientService implements threema.WebClientService {
 
         this.state.reset();
 
+        // Reset the unread count
+        this.resetUnreadCount();
+
         // Clear stored data (trusted key, push token, etc)
         if (deleteStoredData === true) {
             this.trustedKeyStore.clearTrustedKey();
@@ -2351,4 +2354,11 @@ export class WebClientService implements threema.WebClientService {
             .reduce((a: number, b: threema.Conversation) => a + b.unreadCount, 0);
         this.titleService.updateUnreadCount(totalUnreadCount);
     }
+
+    /**
+     * Reset the unread count in the window title
+     */
+    private resetUnreadCount(): void {
+        this.titleService.updateUnreadCount(0);
+    }
 }