Make more of the codebase conform to strict types (#10857)

This commit is contained in:
Michael Telatynski
2023-05-16 14:25:43 +01:00
committed by GitHub
parent 7f017a84c2
commit 6a3f59cc76
45 changed files with 127 additions and 121 deletions
+3 -3
View File
@@ -118,7 +118,7 @@ export class SlidingSyncManager {
private static readonly internalInstance = new SlidingSyncManager();
public slidingSync: SlidingSync;
private client: MatrixClient;
private client?: MatrixClient;
private configureDefer: IDeferred<void>;
@@ -242,8 +242,8 @@ export class SlidingSyncManager {
} else {
subscriptions.delete(roomId);
}
const room = this.client.getRoom(roomId);
let shouldLazyLoad = !this.client.isRoomEncrypted(roomId);
const room = this.client?.getRoom(roomId);
let shouldLazyLoad = !this.client?.isRoomEncrypted(roomId);
if (!room) {
// default to safety: request all state if we can't work it out. This can happen if you
// refresh the app whilst viewing a room: we call setRoomVisible before we know anything