mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
only show delete icon if big enough
This commit is contained in:
parent
405054d802
commit
984121d682
@ -23,9 +23,11 @@ export const makeSelector = (image_name: string) =>
|
||||
({ gallery }) => {
|
||||
const isSelected = gallery.selection.includes(image_name);
|
||||
const selectionCount = gallery.selection.length;
|
||||
const galleryImageMinimumWidth = gallery.galleryImageMinimumWidth;
|
||||
return {
|
||||
isSelected,
|
||||
selectionCount,
|
||||
galleryImageMinimumWidth,
|
||||
};
|
||||
},
|
||||
defaultSelectorOptions
|
||||
@ -44,7 +46,8 @@ const GalleryImage = (props: HoverableImageProps) => {
|
||||
|
||||
const localSelector = useMemo(() => makeSelector(image_name), [image_name]);
|
||||
|
||||
const { isSelected, selectionCount } = useAppSelector(localSelector);
|
||||
const { isSelected, selectionCount, galleryImageMinimumWidth } =
|
||||
useAppSelector(localSelector);
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
@ -113,7 +116,9 @@ const GalleryImage = (props: HoverableImageProps) => {
|
||||
draggableData={draggableData}
|
||||
isSelected={isSelected}
|
||||
minSize={0}
|
||||
onClickReset={handleDelete}
|
||||
onClickReset={
|
||||
galleryImageMinimumWidth > 60 ? handleDelete : undefined
|
||||
}
|
||||
resetIcon={<FaTrash />}
|
||||
resetTooltip="Delete image"
|
||||
imageSx={{ w: 'full', h: 'full' }}
|
||||
|
Loading…
Reference in New Issue
Block a user