Hide explore rooms quick action when active space is an invite
parent
a51aeaa04d
commit
108a3088ef
|
@ -548,6 +548,9 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public render() {
|
public render() {
|
||||||
|
const cli = MatrixClientPeg.get();
|
||||||
|
const userId = cli.getUserId();
|
||||||
|
|
||||||
let explorePrompt: JSX.Element;
|
let explorePrompt: JSX.Element;
|
||||||
if (!this.props.isMinimized) {
|
if (!this.props.isMinimized) {
|
||||||
if (this.state.isNameFiltering) {
|
if (this.state.isNameFiltering) {
|
||||||
|
@ -568,21 +571,23 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
|
||||||
{ this.props.activeSpace ? _t("Explore rooms") : _t("Explore all public rooms") }
|
{ this.props.activeSpace ? _t("Explore rooms") : _t("Explore all public rooms") }
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
</div>;
|
</div>;
|
||||||
} else if (this.props.activeSpace) {
|
} else if (
|
||||||
|
this.props.activeSpace?.canInvite(userId) || this.props.activeSpace?.getMyMembership() === "join"
|
||||||
|
) {
|
||||||
explorePrompt = <div className="mx_RoomList_explorePrompt">
|
explorePrompt = <div className="mx_RoomList_explorePrompt">
|
||||||
<div>{ _t("Quick actions") }</div>
|
<div>{ _t("Quick actions") }</div>
|
||||||
{ this.props.activeSpace.canInvite(MatrixClientPeg.get().getUserId()) && <AccessibleButton
|
{ this.props.activeSpace.canInvite(userId) && <AccessibleButton
|
||||||
className="mx_RoomList_explorePrompt_spaceInvite"
|
className="mx_RoomList_explorePrompt_spaceInvite"
|
||||||
onClick={this.onSpaceInviteClick}
|
onClick={this.onSpaceInviteClick}
|
||||||
>
|
>
|
||||||
{_t("Invite people")}
|
{_t("Invite people")}
|
||||||
</AccessibleButton> }
|
</AccessibleButton> }
|
||||||
<AccessibleButton
|
{ this.props.activeSpace.getMyMembership() === "join" && <AccessibleButton
|
||||||
className="mx_RoomList_explorePrompt_spaceExplore"
|
className="mx_RoomList_explorePrompt_spaceExplore"
|
||||||
onClick={this.onExplore}
|
onClick={this.onExplore}
|
||||||
>
|
>
|
||||||
{_t("Explore rooms")}
|
{_t("Explore rooms")}
|
||||||
</AccessibleButton>
|
</AccessibleButton> }
|
||||||
</div>;
|
</div>;
|
||||||
} else if (Object.values(this.state.sublists).some(list => list.length > 0)) {
|
} else if (Object.values(this.state.sublists).some(list => list.length > 0)) {
|
||||||
const unfilteredLists = RoomListStore.instance.unfilteredLists
|
const unfilteredLists = RoomListStore.instance.unfilteredLists
|
||||||
|
|
Loading…
Reference in New Issue