From 5ac37c8694f8f42c6cadef7225195b35eaea5cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 23 Jan 2020 14:26:35 +0100 Subject: [PATCH] ManageEventIndex: Remove the enable button, that one goes somewhere else. --- .../dialogs/eventindex/ManageEventIndex.js | 86 ++++++------------- 1 file changed, 25 insertions(+), 61 deletions(-) diff --git a/src/async-components/views/dialogs/eventindex/ManageEventIndex.js b/src/async-components/views/dialogs/eventindex/ManageEventIndex.js index cf0e2bccc6..76fee228bf 100644 --- a/src/async-components/views/dialogs/eventindex/ManageEventIndex.js +++ b/src/async-components/views/dialogs/eventindex/ManageEventIndex.js @@ -45,8 +45,6 @@ export default class ManageEventIndex extends React.Component { eventCount: 0, roomCount: 0, currentRoom: null, - eventIndexingEnabled: - SettingsStore.getValueAt(SettingLevel.DEVICE, 'enableEventIndexing'), }; } @@ -108,22 +106,14 @@ export default class ManageEventIndex extends React.Component { ); } - _onEnable = async () => { - this.props.onFinished(false); - } - _onDone = () => { this.props.onFinished(true); } render() { - let eventIndexingSettings = null; - let buttons; let crawlerState; - if (!this.state.eventIndexingEnabled) { - crawlerState = _t("Message search for encrypted rooms is disabled."); - } else if (this.state.currentRoom === null) { + if (this.state.currentRoom === null) { crawlerState = _t("Not downloading messages for any room."); } else { crawlerState = ( @@ -131,58 +121,32 @@ export default class ManageEventIndex extends React.Component { ); } - if (EventIndexPeg.get() !== null) { - eventIndexingSettings = ( -
- { - _t( "Riot is securely caching encrypted messages locally for them " + - "to appear in search results:", - ) - } -
- {_t("Space used:")} {formatBytes(this.state.eventIndexSize, 0)}
- {_t("Indexed messages:")} {this.state.eventCount}
- {_t("Number of rooms:")} {this.state.roomCount}
- {crawlerState}
-
+ const eventIndexingSettings = ( +
+ { + _t( "Riot is securely caching encrypted messages locally for them " + + "to appear in search results:", + ) + } +
+ {_t("Space used:")} {formatBytes(this.state.eventIndexSize, 0)}
+ {_t("Indexed messages:")} {this.state.eventCount}
+ {_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 = ( -
- - {_t("Enable")} - -
- ); - } else { - eventIndexingSettings = ( -
- { - _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.", - ) - } -
- ); - } + const buttons = ( +
+ + {_t("Disable")} + + + {_t("Done")} + +
+ ); const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');