diff --git a/src/stores/notifications/ListNotificationState.ts b/src/stores/notifications/ListNotificationState.ts index 4168fe80b6..97ba2bd80b 100644 --- a/src/stores/notifications/ListNotificationState.ts +++ b/src/stores/notifications/ListNotificationState.ts @@ -31,6 +31,10 @@ export class ListNotificationState extends NotificationState { super(); } + public get symbol(): string { + return this._color === NotificationColor.Unsent ? "!" : null; + } + public setRooms(rooms: Room[]) { // If we're only concerned about the tile count, don't bother setting up listeners. if (this.byTileCount) { @@ -78,7 +82,6 @@ export class ListNotificationState extends NotificationState { private calculateTotalState() { const snapshot = this.snapshot(); - this._symbol = null; if (this.byTileCount) { this._color = NotificationColor.Red; this._count = this.rooms.length; @@ -89,10 +92,6 @@ export class ListNotificationState extends NotificationState { this._count += state.count; this._color = Math.max(this.color, state.color); } - - if (this._color === NotificationColor.Unsent) { - this._symbol = "!"; - } } // finally, publish an update if needed diff --git a/src/stores/notifications/SpaceNotificationState.ts b/src/stores/notifications/SpaceNotificationState.ts index c414a01fc2..137b2ca0f2 100644 --- a/src/stores/notifications/SpaceNotificationState.ts +++ b/src/stores/notifications/SpaceNotificationState.ts @@ -30,6 +30,10 @@ export class SpaceNotificationState extends NotificationState { super(); } + public get symbol(): string { + return this._color === NotificationColor.Unsent ? "!" : null; + } + public setRooms(rooms: Room[]) { const oldRooms = this.rooms; const diff = arrayDiff(oldRooms, rooms); @@ -75,10 +79,7 @@ export class SpaceNotificationState extends NotificationState { this._color = Math.max(this.color, state.color); } - this._symbol = this._color === NotificationColor.Unsent ? "!" : null; - // finally, publish an update if needed this.emitIfUpdated(snapshot); } } -