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

* fix size condition

* listen for listViewIconSize change

* fix invisible condition
This commit is contained in:
nikec 2024-03-28 12:02:48 +01:00 committed by GitHub
parent a4a1f1b40a
commit a6737e4440
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View file

@ -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

View file

@ -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;
},