Conform more of the codebase to strictNullChecks (#10800)
This commit is contained in:
parent
adb29b38a3
commit
456c66db5b
46 changed files with 147 additions and 123 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ export interface PickerIProps {
|
|||
type TabId = "screen" | "window";
|
||||
|
||||
export default class DesktopCapturerSourcePicker extends React.Component<PickerIProps, PickerIState> {
|
||||
public interval: number;
|
||||
public interval?: number;
|
||||
|
||||
public constructor(props: PickerIProps) {
|
||||
super(props);
|
||||
|
|
|
@ -75,8 +75,8 @@ interface IProps {
|
|||
export default class PersistedElement extends React.Component<IProps> {
|
||||
private resizeObserver: ResizeObserver;
|
||||
private dispatcherRef: string;
|
||||
private childContainer: HTMLDivElement;
|
||||
private child: HTMLDivElement;
|
||||
private childContainer?: HTMLDivElement;
|
||||
private child?: HTMLDivElement;
|
||||
|
||||
public constructor(props: IProps) {
|
||||
super(props);
|
||||
|
@ -172,12 +172,12 @@ export default class PersistedElement extends React.Component<IProps> {
|
|||
ReactDOM.render(content, getOrCreateContainer("mx_persistedElement_" + this.props.persistKey));
|
||||
}
|
||||
|
||||
private updateChildVisibility(child: HTMLDivElement, visible: boolean): void {
|
||||
private updateChildVisibility(child?: HTMLDivElement, visible = false): void {
|
||||
if (!child) return;
|
||||
child.style.display = visible ? "block" : "none";
|
||||
}
|
||||
|
||||
private updateChildPosition(child: HTMLDivElement, parent: HTMLDivElement): void {
|
||||
private updateChildPosition(child?: HTMLDivElement, parent?: HTMLDivElement): void {
|
||||
if (!child || !parent) return;
|
||||
|
||||
const parentRect = parent.getBoundingClientRect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue