mirror of https://github.com/vector-im/riot-web
Fix space panel notification badge behaviour and metrics (#7823)
parent
cd49852c2d
commit
2f1d2ed5f8
|
@ -154,15 +154,14 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
|||
|
||||
public setActiveRoomInSpace(space: SpaceKey): void {
|
||||
if (!isMetaSpace(space) && !this.matrixClient?.getRoom(space)?.isSpaceRoom()) return;
|
||||
if (space !== this.activeSpace) this.setActiveSpace(space);
|
||||
if (space !== this.activeSpace) this.setActiveSpace(space, false);
|
||||
|
||||
if (space) {
|
||||
const roomId = this.getNotificationState(space).getFirstRoomWithNotifications();
|
||||
defaultDispatcher.dispatch<ViewRoomPayload>({
|
||||
action: Action.ViewRoom,
|
||||
room_id: roomId,
|
||||
context_switch: true,
|
||||
_trigger: "WebSpaceContextSwitch",
|
||||
_trigger: "WebSpacePanelNotificationBadge",
|
||||
});
|
||||
} else {
|
||||
const lists = RoomListStore.instance.unfilteredLists;
|
||||
|
@ -179,8 +178,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
|
|||
defaultDispatcher.dispatch<ViewRoomPayload>({
|
||||
action: Action.ViewRoom,
|
||||
room_id: unreadRoom.roomId,
|
||||
context_switch: true,
|
||||
_trigger: "WebSpaceContextSwitch",
|
||||
_trigger: "WebSpacePanelNotificationBadge",
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue