EventIndex: Fix some lint errors.

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

View File

@ -431,8 +431,8 @@ export default class EventIndex {
}
currentlyCrawledRooms() {
let crawlingRooms = new Set();
let totalRooms = new Set();
const crawlingRooms = new Set();
const totalRooms = new Set();
this.crawlerCheckpoints.forEach((checkpoint, index) => {
crawlingRooms.add(checkpoint.roomId);
@ -454,6 +454,6 @@ export default class EventIndex {
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"),
default: 3000,
},
"enableCrawling" : {
"enableCrawling": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
displayName: _td("How long should the crawler wait between requests"),
default: true,
}
},
};