From 3073ce55883dc96b2ed88ad1e586920a4fd2f4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 23 Jan 2020 15:05:40 +0100 Subject: [PATCH] DisableEventIndex: Set the correct button kind and add a spinner. --- .../dialogs/eventindex/DisableEventIndex.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/async-components/views/dialogs/eventindex/DisableEventIndex.js b/src/async-components/views/dialogs/eventindex/DisableEventIndex.js index 3dcbeab454..6d0f9a43e8 100644 --- a/src/async-components/views/dialogs/eventindex/DisableEventIndex.js +++ b/src/async-components/views/dialogs/eventindex/DisableEventIndex.js @@ -41,12 +41,15 @@ export default class ManageEventIndex extends React.Component { super(props); this.state = { - eventIndexingEnabled: - SettingsStore.getValueAt(SettingLevel.DEVICE, 'enableEventIndexing'), + disabling: false, }; } _onDisable = async () => { + this.setState({ + disabling: true, + }); + const eventIndex = EventIndexPeg.get(); await SettingsStore.setValue('enableEventIndexing', null, SettingLevel.DEVICE, false); await EventIndexPeg.deleteEventIndex(); @@ -64,12 +67,15 @@ export default class ManageEventIndex extends React.Component { title={_t("Are you sure?")} > {_t("If disabled, messages form encrypted rooms won't appear in search results")} - +
+ + {_t("Cancel")} + + + {_t("Disable")} + + {this.state.enabling ? :
} +
); }