diff --git a/src/components/views/dialogs/SeshatResetDialog.tsx b/src/components/views/dialogs/SeshatResetDialog.tsx index a351b9f15d..09bf25f5cc 100644 --- a/src/components/views/dialogs/SeshatResetDialog.tsx +++ b/src/components/views/dialogs/SeshatResetDialog.tsx @@ -36,8 +36,8 @@ export default class SeshatResetDialog extends React.PureComponent {

{_t( - "Your event store appears corrupted. " + - "This action will restart this application.", + "Your event store appears to be corrupted. " + + "Your messages will be re-indexed as soon as the store is initialised.", )}

diff --git a/src/components/views/settings/EventIndexPanel.js b/src/components/views/settings/EventIndexPanel.js index 773f687524..049ba72d2f 100644 --- a/src/components/views/settings/EventIndexPanel.js +++ b/src/components/views/settings/EventIndexPanel.js @@ -123,11 +123,15 @@ export default class EventIndexPanel extends React.Component { await this.updateState(); } - _confirmEventStoreReset() { - Modal.createDialog(SeshatResetDialog, { - onFinished: (success) => { + _confirmEventStoreReset = () => { + const self = this; + const { close } = Modal.createDialog(SeshatResetDialog, { + onFinished: async (success) => { if (success) { - EventIndexPeg.resetEventStore(); + await SettingsStore.setValue('enableEventIndexing', null, SettingLevel.DEVICE, false); + await EventIndexPeg.deleteEventIndex(); + await self._onEnable(); + close(); } }, }); @@ -223,7 +227,10 @@ export default class EventIndexPanel extends React.Component { eventIndexingSettings = (

- {_t("Message search initilisation failed")} + {this.state.enabling + ? + : _t("Message search initilisation failed") + }

{EventIndexPeg.error && (
diff --git a/src/indexing/BaseEventIndexManager.ts b/src/indexing/BaseEventIndexManager.ts index 2ae47c6d86..2474406618 100644 --- a/src/indexing/BaseEventIndexManager.ts +++ b/src/indexing/BaseEventIndexManager.ts @@ -309,14 +309,4 @@ export default abstract class BaseEventIndexManager { async deleteEventIndex(): Promise { throw new Error("Unimplemented"); } - - /** - * Reset a potentially corrupted event store - * - * @return {Promise} A promise that will resolve once the event store has - * been deleted. - */ - async resetEventStore(): Promise { - throw new Error("Unimplemented"); - } } diff --git a/src/indexing/EventIndexPeg.js b/src/indexing/EventIndexPeg.js index c339ca4209..7004efc554 100644 --- a/src/indexing/EventIndexPeg.js +++ b/src/indexing/EventIndexPeg.js @@ -179,11 +179,6 @@ class EventIndexPeg { await indexManager.deleteEventIndex(); } } - - resetEventStore() { - const indexManager = PlatformPeg.get().getEventIndexingManager(); - return indexManager.resetEventStore(); - } } if (!global.mxEventIndexPeg) {