diff --git a/src/viewmodels/RootViewModel.ts b/src/viewmodels/RootViewModel.ts index 27d4dfa6485d8b12d3438ab4ac9640c1ec58b988..cf72fe1304524866471bd211a7d24e20a08fb301 100644 --- a/src/viewmodels/RootViewModel.ts +++ b/src/viewmodels/RootViewModel.ts @@ -23,6 +23,7 @@ export class RootViewModel extends ViewModel { this._client = new Client(this.platform); this._setupNavigation(); this._messageFromParent.on("maximize", () => this._showTimeline(Promise.resolve())); + // Chatterbox can be minimized via the start button on the parent page! this._messageFromParent.on("minimize", () => this.minimizeChatterbox()); } @@ -97,6 +98,11 @@ export class RootViewModel extends ViewModel { const newCount = room.notificationCount; if (newCount !== previousCount) { if (!room.isUnread && newCount !== 0) { + /* + when chatterbox is maximized and there are previous unread messages, + this condition is hit but we still want to send the notification count so that + the badge zeroes out. + */ room.clearUnread(); return; }