diff --git a/src/app/features/create-room/CreateRoomModal.tsx b/src/app/features/create-room/CreateRoomModal.tsx index 73f87adb..3cd8a032 100644 --- a/src/app/features/create-room/CreateRoomModal.tsx +++ b/src/app/features/create-room/CreateRoomModal.tsx @@ -56,7 +56,7 @@ function CreateRoomModal({ state }: CreateRoomModalProps) { // Set m.space.parent on the new room pointing to parent await mx.sendStateEvent( newRoomId, - StateEvent.SpaceParent, + EventType.SpaceParent, { canonical: true, via: viaServers, @@ -67,7 +67,7 @@ function CreateRoomModal({ state }: CreateRoomModalProps) { // Set m.space.child on the parent room pointing to this sub-room await mx.sendStateEvent( parentSubRoomId, - StateEvent.SpaceChild, + EventType.SpaceChild, { via: viaServers }, newRoomId, ); @@ -79,7 +79,7 @@ function CreateRoomModal({ state }: CreateRoomModalProps) { ); if (parentJoinRulesEvent) { const joinRulesContent = parentJoinRulesEvent.getContent(); - await mx.sendStateEvent(newRoomId, StateEvent.RoomJoinRules, joinRulesContent, ''); + await mx.sendStateEvent(newRoomId, EventType.RoomJoinRules, joinRulesContent, ''); } // Add new room to parent's sub-rooms list @@ -89,12 +89,7 @@ function CreateRoomModal({ state }: CreateRoomModalProps) { const newContent: PaarrotSubRoomsContent = { children: [...currentChildren, newRoomId], }; - await mx.sendStateEvent( - parentSubRoomId, - StateEvent.PaarrotSubRooms as any, - newContent, - '', - ); + await mx.sendStateEvent(parentSubRoomId, StateEvent.PaarrotSubRooms, newContent, ''); // Also add sub-room to parent's space(s) for joining/permissions // The UI will hide it from the top-level display and only show it nested diff --git a/src/types/matrix/room.ts b/src/types/matrix/room.ts index c2a8ee62..4a4cc9ce 100644 --- a/src/types/matrix/room.ts +++ b/src/types/matrix/room.ts @@ -232,6 +232,7 @@ declare module 'matrix-js-sdk' { [StateEvent.PowerLevelTags]: Record; [StateEvent.PoniesRoomEmotes]: PackContent; [StateEvent.PaarrotSubRooms]: PaarrotSubRoomsContent; + [StateEvent.PaarrotRoomKind]: { kind?: string }; } interface TimelineEvents {