Conform more of the codebase to strictNullChecks
(#10358
* Conform more of the codebase to `strictNullChecks` * Fix types * Iterate * Iterate
This commit is contained in:
parent
41d88ad6ae
commit
503df62191
76 changed files with 323 additions and 327 deletions
|
@ -44,7 +44,7 @@ export default class LinkPreviewWidget extends React.Component<IProps> {
|
|||
ev.preventDefault();
|
||||
|
||||
let src = p["og:image"];
|
||||
if (src && src.startsWith("mxc://")) {
|
||||
if (src?.startsWith("mxc://")) {
|
||||
src = mediaFromMxc(src).srcHttp;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ export default class LinkPreviewWidget extends React.Component<IProps> {
|
|||
};
|
||||
}
|
||||
|
||||
Modal.createDialog(ImageView, params, "mx_Dialog_lightbox", null, true);
|
||||
Modal.createDialog(ImageView, params, "mx_Dialog_lightbox", undefined, true);
|
||||
};
|
||||
|
||||
public render(): React.ReactNode {
|
||||
|
@ -78,7 +78,7 @@ export default class LinkPreviewWidget extends React.Component<IProps> {
|
|||
}
|
||||
|
||||
// FIXME: do we want to factor out all image displaying between this and MImageBody - especially for lightboxing?
|
||||
let image = p["og:image"];
|
||||
let image: string | null = p["og:image"] ?? null;
|
||||
if (!SettingsStore.getValue("showImages")) {
|
||||
image = null; // Don't render a button to show the image, just hide it outright
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ export default class LinkPreviewWidget extends React.Component<IProps> {
|
|||
);
|
||||
}
|
||||
|
||||
let img;
|
||||
let img: JSX.Element | undefined;
|
||||
if (image) {
|
||||
img = (
|
||||
<div className="mx_LinkPreviewWidget_image" style={{ height: thumbHeight }}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue