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

Commit 6b28a5f

Browse files
committed
Hide MSC3827 behind a labs flag
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
1 parent 59d96a7 commit 6b28a5f

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/components/views/dialogs/spotlight/SpotlightDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
641641
<div className="mx_SpotlightDialog_sectionHeader">
642642
<h4>{ _t("Suggestions") }</h4>
643643
<div className="mx_SpotlightDialog_options">
644-
{ cli.doesServerSupportUnstableFeature("org.matrix.msc3827") && <>
644+
{ SettingsStore.getValue("feature_exploring_public_spaces") && <>
645645
<LabelledCheckbox
646646
label={_t("Show rooms")}
647647
value={showRooms}

src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export class LabsSettingToggle extends React.Component<ILabsSettingToggleProps>
4949
interface IState {
5050
showHiddenReadReceipts: boolean;
5151
showJumpToDate: boolean;
52+
showExploringPublicSpaces: boolean;
5253
}
5354

5455
export default class LabsUserSettingsTab extends React.Component<{}, IState> {
@@ -63,9 +64,13 @@ export default class LabsUserSettingsTab extends React.Component<{}, IState> {
6364
this.setState({ showJumpToDate });
6465
});
6566

67+
MatrixClientPeg.get().doesServerSupportUnstableFeature("org.matrix.msc3827").
68+
then((showExploringPublicSpaces) => this.setState({ showExploringPublicSpaces }));
69+
6670
this.state = {
6771
showHiddenReadReceipts: false,
6872
showJumpToDate: false,
73+
showExploringPublicSpaces: false,
6974
};
7075
}
7176

@@ -133,6 +138,16 @@ export default class LabsUserSettingsTab extends React.Component<{}, IState> {
133138
);
134139
}
135140

141+
if (this.state.showExploringPublicSpaces) {
142+
groups.getOrCreate(LabGroup.Spaces, []).push(
143+
<SettingsFlag
144+
key="feature_exploring_public_spaces"
145+
name="feature_exploring_public_spaces"
146+
level={SettingLevel.DEVICE}
147+
/>,
148+
);
149+
}
150+
136151
labsSections = <>
137152
{ sortBy(Array.from(groups.entries()), "0").map(([group, flags]) => (
138153
<div className="mx_SettingsTab_section" key={group}>

src/settings/Settings.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ export const SETTINGS: {[setting: string]: ISetting} = {
220220
requiresRefresh: true,
221221
},
222222
},
223+
"feature_exploring_public_spaces": {
224+
displayName: _td("Explore public spaces in the new search dialog"),
225+
supportedLevels: LEVELS_FEATURE,
226+
default: false,
227+
},
223228
"feature_msc3531_hide_messages_pending_moderation": {
224229
isFeature: true,
225230
labsGroup: LabGroup.Moderation,

0 commit comments

Comments
 (0)