Add /jumptodate
slash command (#7372)
Fix https://github.com/vector-im/element-web/issues/7677 Utilizing MSC3030: https://github.com/matrix-org/matrix-doc/pull/3030 Experimental Synapse implementation added in https://github.com/matrix-org/synapse/pull/9445 --- Jump to date headers are being worked on in https://github.com/matrix-org/matrix-react-sdk/pull/7339
This commit is contained in:
parent
48a37985f5
commit
1e09599447
4 changed files with 73 additions and 0 deletions
|
@ -49,6 +49,7 @@ export class LabsSettingToggle extends React.Component<ILabsSettingToggleProps>
|
|||
|
||||
interface IState {
|
||||
showHiddenReadReceipts: boolean;
|
||||
showJumpToDate: boolean;
|
||||
}
|
||||
|
||||
@replaceableComponent("views.settings.tabs.user.LabsUserSettingsTab")
|
||||
|
@ -60,8 +61,13 @@ export default class LabsUserSettingsTab extends React.Component<{}, IState> {
|
|||
this.setState({ showHiddenReadReceipts });
|
||||
});
|
||||
|
||||
MatrixClientPeg.get().doesServerSupportUnstableFeature("org.matrix.msc2716").then((showJumpToDate) => {
|
||||
this.setState({ showJumpToDate });
|
||||
});
|
||||
|
||||
this.state = {
|
||||
showHiddenReadReceipts: false,
|
||||
showJumpToDate: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -135,6 +141,16 @@ export default class LabsUserSettingsTab extends React.Component<{}, IState> {
|
|||
);
|
||||
}
|
||||
|
||||
if (this.state.showJumpToDate) {
|
||||
groups.getOrCreate(LabGroup.Messaging, []).push(
|
||||
<SettingsFlag
|
||||
key="feature_jump_to_date"
|
||||
name="feature_jump_to_date"
|
||||
level={SettingLevel.DEVICE}
|
||||
/>,
|
||||
);
|
||||
}
|
||||
|
||||
labsSection = <div className="mx_SettingsTab_section">
|
||||
{ sortBy(Array.from(groups.entries()), "0").map(([group, flags]) => (
|
||||
<div key={group}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue