From da572d2f12668b63d36c636dcf4423f62a33d7ed Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 10 May 2023 16:05:58 +0100 Subject: [PATCH] Fix people space notification state not updating for new DM invites --- src/stores/spaces/SpaceStore.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/stores/spaces/SpaceStore.ts b/src/stores/spaces/SpaceStore.ts index 73ec56556d7..e91b3c5a45c 100644 --- a/src/stores/spaces/SpaceStore.ts +++ b/src/stores/spaces/SpaceStore.ts @@ -765,7 +765,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient { const hiddenChildren = new EnhancedMap>(); visibleRooms.forEach((room) => { - if (room.getMyMembership() !== "join") return; + if (!["join", "invite"].includes(room.getMyMembership())) return; this.getParents(room.roomId).forEach((parent) => { hiddenChildren.getOrCreate(parent.roomId, new Set()).add(room.roomId); }); @@ -872,10 +872,9 @@ export class SpaceStoreClass extends AsyncStoreWithClient { } const notificationStatesToUpdate = [...changeSet]; - if ( - this.enabledMetaSpaces.includes(MetaSpace.People) && - userDiff.added.length + userDiff.removed.length + usersChanged.length > 0 - ) { + // We update the People metaspace even if we didn't detect any changes + // as roomIdsBySpace does not pre-calculate it so we have to assume it could have changed + if (this.enabledMetaSpaces.includes(MetaSpace.People)) { notificationStatesToUpdate.push(MetaSpace.People); } this.updateNotificationStates(notificationStatesToUpdate);