Make more code conform to strict null checks (#10219
* Make more code conform to strict null checks * Fix types * Fix tests * Fix remaining test assertions * Iterate PR
This commit is contained in:
parent
4c79ecf141
commit
76b82b4b2b
130 changed files with 603 additions and 603 deletions
|
@ -26,6 +26,7 @@ import EventIndexPeg from "../../../indexing/EventIndexPeg";
|
|||
import { SettingLevel } from "../../../settings/SettingLevel";
|
||||
import SeshatResetDialog from "../dialogs/SeshatResetDialog";
|
||||
import InlineSpinner from "../elements/InlineSpinner";
|
||||
import { IIndexStats } from "../../../indexing/BaseEventIndexManager";
|
||||
|
||||
interface IState {
|
||||
enabling: boolean;
|
||||
|
@ -48,10 +49,10 @@ export default class EventIndexPanel extends React.Component<{}, IState> {
|
|||
|
||||
public updateCurrentRoom = async (): Promise<void> => {
|
||||
const eventIndex = EventIndexPeg.get();
|
||||
let stats;
|
||||
let stats: IIndexStats | undefined;
|
||||
|
||||
try {
|
||||
stats = await eventIndex.getStats();
|
||||
stats = await eventIndex?.getStats();
|
||||
} catch {
|
||||
// This call may fail if sporadically, not a huge issue as we will
|
||||
// try later again and probably succeed.
|
||||
|
@ -126,8 +127,8 @@ export default class EventIndexPanel extends React.Component<{}, IState> {
|
|||
});
|
||||
|
||||
await EventIndexPeg.initEventIndex();
|
||||
await EventIndexPeg.get().addInitialCheckpoints();
|
||||
EventIndexPeg.get().startCrawler();
|
||||
await EventIndexPeg.get()?.addInitialCheckpoints();
|
||||
EventIndexPeg.get()?.startCrawler();
|
||||
await SettingsStore.setValue("enableEventIndexing", null, SettingLevel.DEVICE, true);
|
||||
await this.updateState();
|
||||
};
|
||||
|
@ -146,7 +147,7 @@ export default class EventIndexPanel extends React.Component<{}, IState> {
|
|||
};
|
||||
|
||||
public render(): React.ReactNode {
|
||||
let eventIndexingSettings = null;
|
||||
let eventIndexingSettings: JSX.Element | undefined;
|
||||
const brand = SdkConfig.get().brand;
|
||||
|
||||
if (EventIndexPeg.get() !== null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue