Provide RoomViewStore from the RoomContext (#30980)

* Pass roomViewStore to the RoomView and add to the RoomContext.

* lint

* lint

* Make constants more DRY

* Make constants more DRY

* Commend non-null assertion on roomViewStore property of the RoomContext

* Update tsdocs.
This commit is contained in:
David Langley
2025-10-23 10:03:11 +01:00
committed by GitHub
parent 0e6bacffed
commit bea3574b30
6 changed files with 49 additions and 21 deletions

View File

@@ -14,6 +14,7 @@ import { type IRoomState, MainSplitContentType } from "../../src/components/stru
import { TimelineRenderingType } from "../../src/contexts/RoomContext";
import { Layout } from "../../src/settings/enums/Layout";
import { mkEvent } from "./test-utils";
import { SdkContextClass } from "../../src/contexts/SDKContext";
export const makeMembershipEvent = (roomId: string, userId: string, membership = KnownMembership.Join) =>
mkEvent({
@@ -44,6 +45,7 @@ export const makeRoomWithStateEvents = (
export function getRoomContext(room: Room, override: Partial<IRoomState>): IRoomState {
return {
roomViewStore: SdkContextClass.instance.roomViewStore,
room,
roomLoading: true,
peekLoading: false,