[ENG-1698] Fix invisible thumbnails (#2258)

* fix size condition

* listen for listViewIconSize change

* fix invisible condition
This commit is contained in:
nikec authored and GitHub committed 2024-03-28 11:02:48 +00:00
1 parent a4a1f1b40a
commit a6737e4440
2 files changed
+3 -6

No files matched your search

@@ -259,10 +259,7 @@ const Thumbnail = forwardRef<HTMLImageElement, ThumbnailProps>(
<Image
{...props}
{...{
className: clsx(
className,
blackBarsStyle && size.width === 0 && 'invisible'
),
className: clsx(className, blackBars && size.width === 0 && 'invisible'),
style: { ...style, ...(blackBars ? blackBarsStyle : undefined) },
size,
ref
@@ -12,11 +12,11 @@ export function useSize(ref: RefObject<Element>) {
useEffect(() => {
initialized.current = false;
}, [explorerSettings?.gridItemSize]);
}, [explorerSettings?.gridItemSize, explorerSettings?.listViewIconSize]);
useCallbackToWatchResize(
({ width, height }) => {
if (initialized.current) return;
if (initialized.current || (!width && !height)) return;
setSize({ width, height });
initialized.current = true;
},