From 8cab86e58bc819da22440328af36601dce62ff38 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 7 Sep 2021 11:02:38 +0100 Subject: [PATCH] fix typing of firstRoomId --- src/components/structures/SpaceRoomView.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/structures/SpaceRoomView.tsx b/src/components/structures/SpaceRoomView.tsx index 9f21e69bb9..6bb0433448 100644 --- a/src/components/structures/SpaceRoomView.tsx +++ b/src/components/structures/SpaceRoomView.tsx @@ -89,7 +89,7 @@ interface IProps { interface IState { phase: Phase; - firstRoomId?: boolean; // internal state for the creation wizard + firstRoomId?: string; // internal state for the creation wizard showRightPanel: boolean; myMembership: string; } @@ -588,7 +588,11 @@ const SpaceAddExistingRooms = ({ space, onFinished }) => { ; }; -const SpaceSetupPublicShare = ({ justCreatedOpts, space, onFinished, firstRoomId }) => { +interface ISpaceSetupPublicShareProps extends Pick { + onFinished(): void; +} + +const SpaceSetupPublicShare = ({ justCreatedOpts, space, onFinished, firstRoomId }: ISpaceSetupPublicShareProps) => { return

{ _t("Share %(name)s", { name: justCreatedOpts?.createOpts?.name || space.name, @@ -877,7 +881,7 @@ export default class SpaceRoomView extends React.PureComponent { _t("Let's create a room for each of them.") + "\n" + _t("You can add more later too, including already existing ones.") } - onFinished={(firstRoomId: boolean) => this.setState({ phase: Phase.PublicShare, firstRoomId })} + onFinished={(firstRoomId: string) => this.setState({ phase: Phase.PublicShare, firstRoomId })} />; case Phase.PublicShare: return { title={_t("What projects are you working on?")} description={_t("We'll create rooms for each of them. " + "You can add more later too, including already existing ones.")} - onFinished={(firstRoomId: boolean) => this.setState({ phase: Phase.Landing, firstRoomId })} + onFinished={(firstRoomId: string) => this.setState({ phase: Phase.Landing, firstRoomId })} />; case Phase.PrivateExistingRooms: return