mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): remove delete image button in gallery
it was really easy to accidentally click, just commented out, easy to add back or add a setting for it in the future
This commit is contained in:
parent
984121d682
commit
94e38e9769
@ -23,11 +23,10 @@ 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
|
||||
@ -46,8 +45,7 @@ const GalleryImage = (props: HoverableImageProps) => {
|
||||
|
||||
const localSelector = useMemo(() => makeSelector(image_name), [image_name]);
|
||||
|
||||
const { isSelected, selectionCount, galleryImageMinimumWidth } =
|
||||
useAppSelector(localSelector);
|
||||
const { isSelected, selectionCount } = useAppSelector(localSelector);
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
@ -116,13 +114,11 @@ const GalleryImage = (props: HoverableImageProps) => {
|
||||
draggableData={draggableData}
|
||||
isSelected={isSelected}
|
||||
minSize={0}
|
||||
onClickReset={
|
||||
galleryImageMinimumWidth > 60 ? handleDelete : undefined
|
||||
}
|
||||
onClickReset={handleDelete}
|
||||
resetIcon={<FaTrash />}
|
||||
resetTooltip="Delete image"
|
||||
imageSx={{ w: 'full', h: 'full' }}
|
||||
withResetIcon
|
||||
// withResetIcon // removed bc it's too easy to accidentally delete images
|
||||
isDropDisabled={true}
|
||||
isUploadDisabled={true}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user