Conform more of the codebase to strictNullChecks
(#10842)
This commit is contained in:
parent
5eea2c8b02
commit
82e32035fd
24 changed files with 126 additions and 93 deletions
|
@ -32,7 +32,7 @@ export interface IBodyProps {
|
|||
highlightLink?: string;
|
||||
|
||||
/* callback called when dynamic content in events are loaded */
|
||||
onHeightChanged: () => void;
|
||||
onHeightChanged?: () => void;
|
||||
|
||||
showUrlPreview?: boolean;
|
||||
forExport?: boolean;
|
||||
|
@ -40,7 +40,7 @@ export interface IBodyProps {
|
|||
replacingEventId?: string;
|
||||
editState?: EditorStateTransfer;
|
||||
onMessageAllowed: () => void; // TODO: Docs
|
||||
permalinkCreator: RoomPermalinkCreator;
|
||||
permalinkCreator?: RoomPermalinkCreator;
|
||||
mediaEventHelper: MediaEventHelper;
|
||||
|
||||
/*
|
||||
|
|
|
@ -174,7 +174,7 @@ export default class MImageBody extends React.Component<IBodyProps, IState> {
|
|||
|
||||
private onImageLoad = (): void => {
|
||||
this.clearBlurhashTimeout();
|
||||
this.props.onHeightChanged();
|
||||
this.props.onHeightChanged?.();
|
||||
|
||||
let loadedImageDimensions: IState["loadedImageDimensions"];
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ export default class MVideoBody extends React.PureComponent<IBodyProps, IState>
|
|||
decryptedThumbnailUrl: thumbnailUrl,
|
||||
decryptedBlob: await this.props.mediaEventHelper.sourceBlob.value,
|
||||
});
|
||||
this.props.onHeightChanged();
|
||||
this.props.onHeightChanged?.();
|
||||
} else {
|
||||
logger.log("NOT preloading video");
|
||||
const content = this.props.mxEvent.getContent<IMediaEventContent>();
|
||||
|
@ -216,7 +216,7 @@ export default class MVideoBody extends React.PureComponent<IBodyProps, IState>
|
|||
this.videoRef.current.play();
|
||||
},
|
||||
);
|
||||
this.props.onHeightChanged();
|
||||
this.props.onHeightChanged?.();
|
||||
};
|
||||
|
||||
protected get showFileBody(): boolean {
|
||||
|
|
|
@ -173,7 +173,7 @@ export default class TextualBody extends React.Component<IBodyProps, IState> {
|
|||
|
||||
// By expanding/collapsing we changed
|
||||
// the height, therefore we call this
|
||||
this.props.onHeightChanged();
|
||||
this.props.onHeightChanged?.();
|
||||
};
|
||||
|
||||
div.appendChild(button);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue