mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Fix share space edge case where space is public but not invitable
This commit is contained in:
parent
712bdba09f
commit
f31f7b243d
2 changed files with 4 additions and 3 deletions
|
@ -23,6 +23,7 @@ import {copyPlaintext} from "../../../utils/strings";
|
||||||
import {sleep} from "../../../utils/promise";
|
import {sleep} from "../../../utils/promise";
|
||||||
import {RoomPermalinkCreator} from "../../../utils/permalinks/Permalinks";
|
import {RoomPermalinkCreator} from "../../../utils/permalinks/Permalinks";
|
||||||
import {showRoomInviteDialog} from "../../../RoomInvite";
|
import {showRoomInviteDialog} from "../../../RoomInvite";
|
||||||
|
import {MatrixClientPeg} from "../../../MatrixClientPeg";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
space: Room;
|
space: Room;
|
||||||
|
@ -50,7 +51,7 @@ const SpacePublicShare = ({ space, onFinished }: IProps) => {
|
||||||
<h3>{ _t("Share invite link") }</h3>
|
<h3>{ _t("Share invite link") }</h3>
|
||||||
<span>{ copiedText }</span>
|
<span>{ copiedText }</span>
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
<AccessibleButton
|
{ space.canInvite(MatrixClientPeg.get()?.getUserId()) ? <AccessibleButton
|
||||||
className="mx_SpacePublicShare_inviteButton"
|
className="mx_SpacePublicShare_inviteButton"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
showRoomInviteDialog(space.roomId);
|
showRoomInviteDialog(space.roomId);
|
||||||
|
@ -59,7 +60,7 @@ const SpacePublicShare = ({ space, onFinished }: IProps) => {
|
||||||
>
|
>
|
||||||
<h3>{ _t("Invite people") }</h3>
|
<h3>{ _t("Invite people") }</h3>
|
||||||
<span>{ _t("Invite with email or username") }</span>
|
<span>{ _t("Invite with email or username") }</span>
|
||||||
</AccessibleButton>
|
</AccessibleButton> : null }
|
||||||
</div>;
|
</div>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@ export class SpaceItem extends React.PureComponent<IItemProps, IItemState> {
|
||||||
const userId = this.context.getUserId();
|
const userId = this.context.getUserId();
|
||||||
|
|
||||||
let inviteOption;
|
let inviteOption;
|
||||||
if (this.props.space.canInvite(userId)) {
|
if (this.props.space.getJoinRule() === "public" || this.props.space.canInvite(userId)) {
|
||||||
inviteOption = (
|
inviteOption = (
|
||||||
<IconizedContextMenuOption
|
<IconizedContextMenuOption
|
||||||
className="mx_SpacePanel_contextMenu_inviteButton"
|
className="mx_SpacePanel_contextMenu_inviteButton"
|
||||||
|
|
Loading…
Reference in a new issue