diff --git a/src/async-components/views/dialogs/eventindex/ManageEventIndex.js b/src/async-components/views/dialogs/eventindex/ManageEventIndex.js
index d9a0cdcb5d..754d1b8516 100644
--- a/src/async-components/views/dialogs/eventindex/ManageEventIndex.js
+++ b/src/async-components/views/dialogs/eventindex/ManageEventIndex.js
@@ -116,7 +116,11 @@ export default class ManageEventIndex extends React.Component {
SettingsStore.setValue("crawlerSleepTime", null, SettingLevel.DEVICE, e.target.value);
}
- _onDisable = () => {
+ _onDisable = async () => {
+ this.props.onFinished(false);
+ }
+
+ _onEnable = async () => {
this.props.onFinished(false);
}
@@ -126,17 +130,16 @@ export default class ManageEventIndex extends React.Component {
render() {
let eventIndexingSettings = null;
+ let buttons;
let crawlerState;
if (!this.state.eventIndexingEnabled) {
- crawlerState =
{_t("Message search for encrypted rooms is disabled.")}
;
+ crawlerState = _t("Message search for encrypted rooms is disabled.");
} else if (this.state.currentRoom === null) {
- crawlerState = {_t("Not downloading messages for any room.")}
;
+ crawlerState = _t("Not downloading messages for any room.");
} else {
crawlerState = (
-
- {_t("Downloading mesages for %(currentRoom)s.", { currentRoom: this.state.currentRoom })}
-
+ _t("Downloading mesages for %(currentRoom)s.", { currentRoom: this.state.currentRoom })
);
}
@@ -154,18 +157,30 @@ export default class ManageEventIndex extends React.Component {
{_t("Number of rooms:")} {this.state.roomCount}
{crawlerState}
+
+ );
-
-
-
+ buttons = (
+
+
+ {_t("Disable")}
+
+
+ {_t("Done")}
+
+
+ );
+ } else if (!this.state.eventIndexingEnabled && this.state.eventIndexingInstalled) {
+ eventIndexingSettings = (
+
+ {_t( "Securely cache encrypted messages locally for them to appear in search results.")}
+
+ );
+ buttons = (
+
);
} else {
@@ -182,28 +197,14 @@ export default class ManageEventIndex extends React.Component {
}
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
- const buttons =
-
-
- {_t("Disable")}
-
-
- {_t("Done")}
-
-
-
;
return (
{}}
+ onFinished={this.props.onFinished}
title={_t("Message search")}
>
-
- {eventIndexingSettings}
-
-
- {buttons}
-
+ {eventIndexingSettings}
+ {buttons}
);
}