From f706a13230f925d85add0ab04ecbeec2deaeaf2b Mon Sep 17 00:00:00 2001 From: Daniel Abrao Date: Sun, 14 Apr 2024 19:51:20 -0300 Subject: [PATCH] Adjust gallery image length handling --- .../deleteImageModal/components/DeleteImageButton.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageButton.tsx b/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageButton.tsx index 712be41c2e..6855cb8e55 100644 --- a/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageButton.tsx +++ b/invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageButton.tsx @@ -13,11 +13,8 @@ export const DeleteImageButton = memo((props: DeleteImageButtonProps) => { const { onClick, isDisabled } = props; const { t } = useTranslation(); const isConnected = useAppSelector((s) => s.system.isConnected); - const imageSelectionLength: number = (useAppSelector((s) => s.gallery.selection) || []).length; - const labelMessage: string = - imageSelectionLength > 1 - ? t('gallery.deleteImage_plural', { count: imageSelectionLength }) - : t('gallery.deleteImage'); + const imageSelectionLength: number = useAppSelector((s) => s.gallery.selection.length); + const labelMessage: string = `${t('gallery.deleteImage', { count: imageSelectionLength })} (Del)`; return (