diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx index b736b85d7d81..105d98a8e0b7 100644 --- a/src/stores/SpaceStore.tsx +++ b/src/stores/SpaceStore.tsx @@ -133,17 +133,19 @@ export class SpaceStoreClass extends AsyncStoreWithClient { const notificationState = this.getNotificationState(space.roomId) const roomId = notificationState.getFirstRoomWithNotifications(); defaultDispatcher.dispatch({ - action: "view_room", - room_id: roomId, - context_switch: true, + action: "view_room", + room_id: roomId, + context_switch: true, }); } else { const lists = RoomListStore.instance.unfilteredLists; TAG_ORDER.every(t => { const listRooms = lists[t]; const unreadRoom = listRooms.find((r: Room)=> { - const state = RoomNotificationStateStore.instance.getRoomState(r); - return state.isUnread; + if (this.showInHomeSpace(r)) { + const state = RoomNotificationStateStore.instance.getRoomState(r); + return state.isUnread; + } }); if (unreadRoom) { defaultDispatcher.dispatch({