From d3ba33172b8e195233528eb991c0bd0f9d2f0bac Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 31 Aug 2021 16:42:21 +0100 Subject: [PATCH] Only make the initial space rooms suggested by default --- src/components/structures/SpaceRoomView.tsx | 1 + src/createRoom.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/structures/SpaceRoomView.tsx b/src/components/structures/SpaceRoomView.tsx index 767e0999c3..5c9662dcf7 100644 --- a/src/components/structures/SpaceRoomView.tsx +++ b/src/components/structures/SpaceRoomView.tsx @@ -517,6 +517,7 @@ const SpaceSetupFirstRooms = ({ space, title, description, onFinished }) => { andView: false, inlineErrors: true, parentSpace: space, + suggested: true, }); })); onFinished(filteredRoomNames.length > 0); diff --git a/src/createRoom.ts b/src/createRoom.ts index 31774bf56f..25e7257289 100644 --- a/src/createRoom.ts +++ b/src/createRoom.ts @@ -62,6 +62,8 @@ export interface IOpts { roomType?: RoomType | string; historyVisibility?: HistoryVisibility; parentSpace?: Room; + // contextually only makes sense if parentSpace is specified, if true then will be added to parentSpace as suggested + suggested?: boolean; joinRule?: JoinRule; } @@ -228,7 +230,7 @@ export default async function createRoom(opts: IOpts): Promise { } }).then(() => { if (opts.parentSpace) { - return SpaceStore.instance.addRoomToSpace(opts.parentSpace, roomId, [client.getDomain()], true); + return SpaceStore.instance.addRoomToSpace(opts.parentSpace, roomId, [client.getDomain()], opts.suggested); } if (opts.associatedWithCommunity) { return GroupStore.addRoomToGroup(opts.associatedWithCommunity, roomId, false);