diff --git a/web/src/api/statestore/main.ts b/web/src/api/statestore/main.ts index 78dadf0..ec1ecb5 100644 --- a/web/src/api/statestore/main.ts +++ b/web/src/api/statestore/main.ts @@ -537,6 +537,7 @@ export class StateStore { this.rooms.clear() this.inviteRooms.clear() this.spaceEdges.clear() + this.pseudoSpaces.forEach(space => space.clearUnreads()) this.roomList.emit([]) this.topLevelSpaces.emit([]) this.accountData.clear() diff --git a/web/src/api/statestore/space.ts b/web/src/api/statestore/space.ts index f54cc4c..96b37b8 100644 --- a/web/src/api/statestore/space.ts +++ b/web/src/api/statestore/space.ts @@ -40,6 +40,10 @@ export abstract class Space implements RoomListFilter { abstract id: string abstract include(room: RoomListEntry): boolean + clearUnreads() { + this.counts.emit(emptyUnreadCounts) + } + applyUnreads(newCounts?: SpaceUnreadCounts | null, oldCounts?: SpaceUnreadCounts | null) { const mergedCounts: SpaceUnreadCounts = { unread_messages: this.counts.current.unread_messages