1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-17 17:42:41 +03:00

EventIndexPanel: Move the panel from the preferences to the security tab.

This commit is contained in:
Damir Jelić
2020-01-21 10:06:04 +01:00
parent 4913d579e3
commit 908a00a13d
4 changed files with 24 additions and 8 deletions

View File

@@ -138,8 +138,7 @@ export default class EventIndexPanel extends React.Component {
if (EventIndexPeg.get() !== null) {
eventIndexingSettings = (
<div className="mx_SettingsTab_section">
<span className="mx_SettingsTab_subheading">{_t("Encrypted search")}</span>
<div>
{
_t( "Riot is securely caching encrypted messages locally for them" +
"to appear in search results:"
@@ -165,6 +164,17 @@ export default class EventIndexPanel extends React.Component {
onChange={this._onCrawlerSleepTimeChange} />
</div>
);
} else {
eventIndexingSettings = (
<div>
{
_t( "Riot can't securely cache encrypted messages locally" +
"while running in a web browser. Use Riot Desktop for" +
"encrypted messages to appear in search results."
)
}
</div>
);
}
return eventIndexingSettings;

View File

@@ -144,8 +144,6 @@ export default class PreferencesUserSettingsTab extends React.Component {
}
render() {
const EventIndexPanel = sdk.getComponent('views.settings.EventIndexPanel');
let autoLaunchOption = null;
if (this.state.autoLaunchSupported) {
autoLaunchOption = <LabelledToggleSwitch
@@ -174,8 +172,6 @@ export default class PreferencesUserSettingsTab extends React.Component {
<div className="mx_SettingsTab mx_PreferencesUserSettingsTab">
<div className="mx_SettingsTab_heading">{_t("Preferences")}</div>
<EventIndexPanel />
<div className="mx_SettingsTab_section">
<span className="mx_SettingsTab_subheading">{_t("Composer")}</span>
{this._renderGroup(PreferencesUserSettingsTab.COMPOSER_SETTINGS)}

View File

@@ -242,6 +242,7 @@ export default class SecurityUserSettingsTab extends React.Component {
render() {
const DevicesPanel = sdk.getComponent('views.settings.DevicesPanel');
const SettingsFlag = sdk.getComponent('views.elements.SettingsFlag');
const EventIndexPanel = sdk.getComponent('views.settings.EventIndexPanel');
const KeyBackupPanel = sdk.getComponent('views.settings.KeyBackupPanel');
const keyBackup = (
@@ -253,6 +254,13 @@ export default class SecurityUserSettingsTab extends React.Component {
</div>
);
const eventIndex = (
<div className="mx_SettingsTab_section">
<span className="mx_SettingsTab_subheading">{_t("Encrypted search")}</span>
<EventIndexPanel />
</div>
);
// XXX: There's no such panel in the current cross-signing designs, but
// it's useful to have for testing the feature. If there's no interest
// in having advanced details here once all flows are implemented, we
@@ -281,6 +289,7 @@ export default class SecurityUserSettingsTab extends React.Component {
</div>
</div>
{keyBackup}
{eventIndex}
{crossSigning}
{this._renderCurrentDeviceInfo()}
<div className='mx_SettingsTab_section'>