Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix build issues from two conflicting PRs landing without merge conflict #6780

Merged
merged 1 commit into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
}

let advanced;
if (this.state.joinRule === JoinRule.Public) {
if (room.getJoinRule() === JoinRule.Public) {
advanced = (
<>
<AccessibleButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { useStateToggle } from "../../../hooks/useStateToggle";
import LabelledToggleSwitch from "../elements/LabelledToggleSwitch";
import { useLocalEcho } from "../../../hooks/useLocalEcho";
import JoinRuleSettings from "../settings/JoinRuleSettings";
import { useRoomState } from "../../../hooks/useRoomState";

interface IProps {
matrixClient: MatrixClient;
Expand All @@ -39,6 +40,7 @@ const SpaceSettingsVisibilityTab = ({ matrixClient: cli, space, closeSettingsFn

const userId = cli.getUserId();

const joinRule = useRoomState(space, state => state.getJoinRule());
const [guestAccessEnabled, setGuestAccessEnabled] = useLocalEcho<boolean>(
() => space.currentState.getStateEvents(EventType.RoomGuestAccess, "")
?.getContent()?.guest_access === GuestAccess.CanJoin,
Expand All @@ -64,7 +66,7 @@ const SpaceSettingsVisibilityTab = ({ matrixClient: cli, space, closeSettingsFn
const canonicalAliasEv = space.currentState.getStateEvents(EventType.RoomCanonicalAlias, "");

let advancedSection;
if (visibility === SpaceVisibility.Unlisted) {
if (joinRule === JoinRule.Public) {
if (showAdvancedSection) {
advancedSection = <>
<AccessibleButton onClick={toggleAdvancedSection} kind="link" className="mx_SettingsTab_showAdvanced">
Expand Down