mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-02 08:53:32 +00:00
[ENG-1698] Fix invisible thumbnails (#2258)
* fix size condition * listen for listViewIconSize change * fix invisible condition
This commit is contained in:
parent
a4a1f1b40a
commit
a6737e4440
|
@ -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;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue