EventIndex: Fix some lint errors.

This commit is contained in:
Damir Jelić 2019-11-26 15:06:04 +01:00
parent c397de18bd
commit 3c46a56391
3 changed files with 10 additions and 11 deletions

View file

@ -113,11 +113,11 @@ export default class PreferencesUserSettingsTab extends React.Component {
let crawlingRooms = 0; let crawlingRooms = 0;
let totalCrawlingRooms = 0; let totalCrawlingRooms = 0;
let eventIndex = EventIndexPeg.get(); const eventIndex = EventIndexPeg.get();
if (eventIndex !== null) { if (eventIndex !== null) {
eventIndexSize = await eventIndex.indexSize(); eventIndexSize = await eventIndex.indexSize();
let crawledRooms = eventIndex.currentlyCrawledRooms(); const crawledRooms = eventIndex.currentlyCrawledRooms();
crawlingRooms = crawledRooms.crawlingRooms.size; crawlingRooms = crawledRooms.crawlingRooms.size;
totalCrawlingRooms = crawledRooms.totalRooms.size; totalCrawlingRooms = crawledRooms.totalRooms.size;
} }
@ -211,8 +211,7 @@ export default class PreferencesUserSettingsTab extends React.Component {
if (!this.state.eventIndexingEnabled) { if (!this.state.eventIndexingEnabled) {
crawlerState = <div>{_t("Message downloader is stopped.")}</div>; crawlerState = <div>{_t("Message downloader is stopped.")}</div>;
} } else if (this.state.crawlingRooms === 0) {
else if (this.state.crawlingRooms === 0) {
crawlerState = <div>{_t("Message downloader is currently idle.")}</div>; crawlerState = <div>{_t("Message downloader is currently idle.")}</div>;
} else { } else {
crawlerState = ( crawlerState = (
@ -231,8 +230,8 @@ export default class PreferencesUserSettingsTab extends React.Component {
<span className="mx_SettingsTab_subheading">{_t("Encrypted search")}</span> <span className="mx_SettingsTab_subheading">{_t("Encrypted search")}</span>
{ {
_t( "To enable search in encrypted rooms, Riot needs to run " + _t( "To enable search in encrypted rooms, Riot needs to run " +
"a background process to download historical messages " + "a background process to download historical messages " +
"from those rooms to your computer." "from those rooms to your computer.",
) )
} }
<div className='mx_SettingsTab_subsectionText'> <div className='mx_SettingsTab_subsectionText'>

View file

@ -431,8 +431,8 @@ export default class EventIndex {
} }
currentlyCrawledRooms() { currentlyCrawledRooms() {
let crawlingRooms = new Set(); const crawlingRooms = new Set();
let totalRooms = new Set(); const totalRooms = new Set();
this.crawlerCheckpoints.forEach((checkpoint, index) => { this.crawlerCheckpoints.forEach((checkpoint, index) => {
crawlingRooms.add(checkpoint.roomId); crawlingRooms.add(checkpoint.roomId);
@ -454,6 +454,6 @@ export default class EventIndex {
totalRooms.add(room.roomId); totalRooms.add(room.roomId);
}); });
return {crawlingRooms, totalRooms} return {crawlingRooms, totalRooms};
} }
} }

View file

@ -491,9 +491,9 @@ export const SETTINGS = {
displayName: _td("How long should the crawler wait between requests"), displayName: _td("How long should the crawler wait between requests"),
default: 3000, default: 3000,
}, },
"enableCrawling" : { "enableCrawling": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS, supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
displayName: _td("How long should the crawler wait between requests"), displayName: _td("How long should the crawler wait between requests"),
default: true, default: true,
} },
}; };