diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/StyleProvider.tsx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx index 34418e170..a88c745b8 100644 --- a/src/client/views/StyleProvider.tsx +++ b/src/client/views/StyleProvider.tsx @@ -90,9 +90,8 @@ export function DefaultStyleProvider(doc: Opt<Doc>, props: Opt<DocumentViewProps const random = (min: number, max: number, x: number, y: number) => /* min should not be equal to max */ min + ((Math.abs(x * y) * 9301 + 49297) % 233280 / 233280) * (max - min); switch (property.split(":")[0]) { case StyleProp.TreeViewIcon: - const icon = Cast(doc?.layout_icon, Doc, null) ? Doc.expandTemplateLayout(Cast(doc?.layout_icon, Doc, null), doc) : undefined; - if (icon && ImageCast(doc?.icon, ImageCast(doc?.data))) { - const img = ImageCast(doc?.icon, ImageCast(doc?.data)); + const img = ImageCast(doc?.icon, ImageCast(doc?.data)); + if (img) { const ext = extname(img.url.href); const url = doc?.icon ? img.url.href : img.url.href.replace(ext, "_s" + ext); return <img src={url} width={20} height={15} style={{ margin: "auto", display: "block", objectFit: "contain" }} />; |