Conform more of the codebase to strictNullChecks (#10800)

This commit is contained in:
Michael Telatynski 2023-05-10 08:41:55 +01:00 committed by GitHub
parent adb29b38a3
commit 456c66db5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 147 additions and 123 deletions

View file

@ -121,11 +121,11 @@ export default class AppTile extends React.Component<IProps, IState> {
};
private contextMenuButton = createRef<any>();
private iframe: HTMLIFrameElement; // ref to the iframe (callback style)
private allowedWidgetsWatchRef: string;
private iframe?: HTMLIFrameElement; // ref to the iframe (callback style)
private allowedWidgetsWatchRef?: string;
private persistKey: string;
private sgWidget: StopGapWidget | null;
private dispatcherRef: string;
private dispatcherRef?: string;
private unmounted: boolean;
public constructor(props: IProps) {
@ -305,7 +305,7 @@ export default class AppTile extends React.Component<IProps, IState> {
this.context.off(RoomEvent.MyMembership, this.onMyMembership);
}
SettingsStore.unwatchSetting(this.allowedWidgetsWatchRef);
if (this.allowedWidgetsWatchRef) SettingsStore.unwatchSetting(this.allowedWidgetsWatchRef);
OwnProfileStore.instance.removeListener(UPDATE_EVENT, this.onUserReady);
}
@ -344,7 +344,7 @@ export default class AppTile extends React.Component<IProps, IState> {
private startMessaging(): void {
try {
this.sgWidget?.startMessaging(this.iframe);
this.sgWidget?.startMessaging(this.iframe!);
} catch (e) {
logger.error("Failed to start widget", e);
}