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
|
@ -15,14 +15,15 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
import React, { ComponentProps } from "react";
|
||||
import { IWidget } from "matrix-widget-api";
|
||||
import classNames from "classnames";
|
||||
|
||||
import { IApp } from "../../../stores/WidgetStore";
|
||||
import { IApp, isAppWidget } from "../../../stores/WidgetStore";
|
||||
import BaseAvatar, { BaseAvatarType } from "./BaseAvatar";
|
||||
import { mediaFromMxc } from "../../../customisations/Media";
|
||||
|
||||
interface IProps extends Omit<ComponentProps<BaseAvatarType>, "name" | "url" | "urls" | "height" | "width"> {
|
||||
app: IApp;
|
||||
app: IApp | IWidget;
|
||||
height?: number;
|
||||
width?: number;
|
||||
}
|
||||
|
@ -46,7 +47,7 @@ const WidgetAvatar: React.FC<IProps> = ({ app, className, width = 20, height = 2
|
|||
name={app.id}
|
||||
className={classNames("mx_WidgetAvatar", className)}
|
||||
// MSC2765
|
||||
url={app.avatar_url ? mediaFromMxc(app.avatar_url).getSquareThumbnailHttp(20) : null}
|
||||
url={isAppWidget(app) && app.avatar_url ? mediaFromMxc(app.avatar_url).getSquareThumbnailHttp(20) : null}
|
||||
urls={iconUrls}
|
||||
width={width}
|
||||
height={height}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue