diff --git a/src/components/views/spaces/SpacePublicShare.tsx b/src/components/views/spaces/SpacePublicShare.tsx
index fa81b75525..207360c2c2 100644
--- a/src/components/views/spaces/SpacePublicShare.tsx
+++ b/src/components/views/spaces/SpacePublicShare.tsx
@@ -23,6 +23,7 @@ import {copyPlaintext} from "../../../utils/strings";
import {sleep} from "../../../utils/promise";
import {RoomPermalinkCreator} from "../../../utils/permalinks/Permalinks";
import {showRoomInviteDialog} from "../../../RoomInvite";
+import {MatrixClientPeg} from "../../../MatrixClientPeg";
interface IProps {
space: Room;
@@ -50,7 +51,7 @@ const SpacePublicShare = ({ space, onFinished }: IProps) => {
{ _t("Share invite link") }
{ copiedText }
- {
showRoomInviteDialog(space.roomId);
@@ -59,7 +60,7 @@ const SpacePublicShare = ({ space, onFinished }: IProps) => {
>
{ _t("Invite people") }
{ _t("Invite with email or username") }
-
+ : null }
;
};
diff --git a/src/components/views/spaces/SpaceTreeLevel.tsx b/src/components/views/spaces/SpaceTreeLevel.tsx
index f0a0605584..f34baf256b 100644
--- a/src/components/views/spaces/SpaceTreeLevel.tsx
+++ b/src/components/views/spaces/SpaceTreeLevel.tsx
@@ -209,7 +209,7 @@ export class SpaceItem extends React.PureComponent {
const userId = this.context.getUserId();
let inviteOption;
- if (this.props.space.canInvite(userId)) {
+ if (this.props.space.getJoinRule() === "public" || this.props.space.canInvite(userId)) {
inviteOption = (