diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js
index db5b95cb4c..d1fed21a1f 100644
--- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js
+++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js
@@ -23,6 +23,8 @@ import SettingsStore from "../../../../../settings/SettingsStore";
import Field from "../../../elements/Field";
import * as sdk from "../../../../..";
import PlatformPeg from "../../../../../PlatformPeg";
+import EventIndexPeg from "../../../../../indexing/EventIndexPeg";
+import {formatBytes} from "../../../../../utils/FormattingUtils";
export default class PreferencesUserSettingsTab extends React.Component {
static COMPOSER_SETTINGS = [
@@ -70,6 +72,13 @@ export default class PreferencesUserSettingsTab extends React.Component {
alwaysShowMenuBarSupported: false,
minimizeToTray: true,
minimizeToTraySupported: false,
+ eventIndexSize: 0,
+ crawlingRooms: 0,
+ totalCrawlingRooms: 0,
+ eventIndexingEnabled:
+ SettingsStore.getValueAt(SettingLevel.DEVICE, 'enableCrawling'),
+ crawlerSleepTime:
+ SettingsStore.getValueAt(SettingLevel.DEVICE, 'crawlerSleepTime'),
autocompleteDelay:
SettingsStore.getValueAt(SettingLevel.DEVICE, 'autocompleteDelay').toString(10),
readMarkerInViewThresholdMs:
@@ -100,6 +109,19 @@ export default class PreferencesUserSettingsTab extends React.Component {
minimizeToTray = await platform.getMinimizeToTrayEnabled();
}
+ let eventIndexSize = 0;
+ let crawlingRooms = 0;
+ let totalCrawlingRooms = 0;
+
+ let eventIndex = EventIndexPeg.get();
+
+ if (eventIndex !== null) {
+ eventIndexSize = await eventIndex.indexSize();
+ let crawledRooms = eventIndex.currentlyCrawledRooms();
+ crawlingRooms = crawledRooms.crawlingRooms.size;
+ totalCrawlingRooms = crawledRooms.totalRooms.size;
+ }
+
this.setState({
autoLaunch,
autoLaunchSupported,
@@ -107,6 +129,9 @@ export default class PreferencesUserSettingsTab extends React.Component {
alwaysShowMenuBar,
minimizeToTraySupported,
minimizeToTray,
+ eventIndexSize,
+ crawlingRooms,
+ totalCrawlingRooms,
});
}
@@ -137,6 +162,20 @@ export default class PreferencesUserSettingsTab extends React.Component {
SettingsStore.setValue("readMarkerOutOfViewThresholdMs", null, SettingLevel.DEVICE, e.target.value);
};
+ _onEventIndexingEnabledChange = (checked) => {
+ SettingsStore.setValue("enableCrawling", null, SettingLevel.DEVICE, checked);
+
+ if (checked) EventIndexPeg.start();
+ else EventIndexPeg.stop();
+
+ this.setState({eventIndexingEnabled: checked});
+ }
+
+ _onCrawlerSleepTimeChange = (e) => {
+ this.setState({crawlerSleepTime: e.target.value});
+ SettingsStore.setValue("crawlerSleepTime", null, SettingLevel.DEVICE, e.target.value);
+ }
+
_renderGroup(settingIds) {
const SettingsFlag = sdk.getComponent("views.elements.SettingsFlag");
return settingIds.map(i =>