Implement MSC3827: Filtering of /publicRooms
by room type (#8866)
This commit is contained in:
parent
18c21d77cd
commit
663bca559f
8 changed files with 96 additions and 21 deletions
|
@ -49,23 +49,31 @@ export class LabsSettingToggle extends React.Component<ILabsSettingToggleProps>
|
|||
interface IState {
|
||||
showHiddenReadReceipts: boolean;
|
||||
showJumpToDate: boolean;
|
||||
showExploringPublicSpaces: boolean;
|
||||
}
|
||||
|
||||
export default class LabsUserSettingsTab extends React.Component<{}, IState> {
|
||||
constructor(props: {}) {
|
||||
super(props);
|
||||
|
||||
MatrixClientPeg.get().doesServerSupportUnstableFeature("org.matrix.msc2285").then((showHiddenReadReceipts) => {
|
||||
const cli = MatrixClientPeg.get();
|
||||
|
||||
cli.doesServerSupportUnstableFeature("org.matrix.msc2285").then((showHiddenReadReceipts) => {
|
||||
this.setState({ showHiddenReadReceipts });
|
||||
});
|
||||
|
||||
MatrixClientPeg.get().doesServerSupportUnstableFeature("org.matrix.msc3030").then((showJumpToDate) => {
|
||||
cli.doesServerSupportUnstableFeature("org.matrix.msc3030").then((showJumpToDate) => {
|
||||
this.setState({ showJumpToDate });
|
||||
});
|
||||
|
||||
cli.doesServerSupportUnstableFeature("org.matrix.msc3827").then((showExploringPublicSpaces) => {
|
||||
this.setState({ showExploringPublicSpaces });
|
||||
});
|
||||
|
||||
this.state = {
|
||||
showHiddenReadReceipts: false,
|
||||
showJumpToDate: false,
|
||||
showExploringPublicSpaces: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -133,6 +141,16 @@ export default class LabsUserSettingsTab extends React.Component<{}, IState> {
|
|||
);
|
||||
}
|
||||
|
||||
if (this.state.showExploringPublicSpaces) {
|
||||
groups.getOrCreate(LabGroup.Spaces, []).push(
|
||||
<SettingsFlag
|
||||
key="feature_exploring_public_spaces"
|
||||
name="feature_exploring_public_spaces"
|
||||
level={SettingLevel.DEVICE}
|
||||
/>,
|
||||
);
|
||||
}
|
||||
|
||||
labsSections = <>
|
||||
{ sortBy(Array.from(groups.entries()), "0").map(([group, flags]) => (
|
||||
<div className="mx_SettingsTab_section" key={group}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue