Support joining non-peekable rooms via the module API (#10154)

When previewing a room, we normally do not have a Room object. Currently, when the RoomPreviewBar is instantiated without a room, it doesn't raise the PreviewRoomNotLoggedIn and JoinFromRoomPreview module lifecycle events, meaning that modules are unable to intercept previews of non-peekable rooms.

To fix this, make sure that we pass the room ID into RoomPreviewBar irrespective of whether we have a Room object, and use it to raise the module lifecycle events.

Signed-off-by: Mikhail Aheichyk <mikhail.aheichyk@nordeck.net>
This commit is contained in:
maheichyk 2023-02-23 13:29:21 +03:00 committed by GitHub
parent 880428ab94
commit d0c266d4a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 8 deletions

View file

@ -73,6 +73,7 @@ describe("<RoomPreviewBar />", () => {
const getComponent = (props: ComponentProps<typeof RoomPreviewBar> = {}) => {
const defaultProps = {
roomId,
room: createRoom(roomId, userId),
};
return render(<RoomPreviewBar {...defaultProps} {...props} />);