diff options
| author | bobzel <zzzman@gmail.com> | 2022-04-27 13:04:48 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-04-27 13:04:48 -0400 |
| commit | 97141270061f67e6ea867ba0b30a5e5111ae8c51 (patch) | |
| tree | d7b4d5e1674f0e5b19d5158eb47f871d631e6e90 | |
| parent | 9f3f64bb5bd3c7d5c97dfcbad39306cab465b822 (diff) | |
fixed tree view icons to not needlessly use the layout_icon doc
| -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" }} />; |
