From a071f2788ace5bbc6e961bfda590d20f0beb8c58 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Wed, 16 Oct 2024 11:37:25 -0400 Subject: [PATCH] fix(ui): upload tooltip should only show plural if multiple upload is an option --- .../gallery/components/GalleryUploadButton.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/features/gallery/components/GalleryUploadButton.tsx b/invokeai/frontend/web/src/features/gallery/components/GalleryUploadButton.tsx index bc456783d6..b0a7c25816 100644 --- a/invokeai/frontend/web/src/features/gallery/components/GalleryUploadButton.tsx +++ b/invokeai/frontend/web/src/features/gallery/components/GalleryUploadButton.tsx @@ -1,5 +1,7 @@ import { IconButton } from '@invoke-ai/ui-library'; +import { useAppSelector } from 'app/store/storeHooks'; import { useImageUploadButton } from 'common/hooks/useImageUploadButton'; +import { selectMaxImageUploadCount } from 'features/system/store/configSlice'; import { t } from 'i18next'; import { PiUploadBold } from 'react-icons/pi'; @@ -7,14 +9,23 @@ const options = { postUploadAction: { type: 'TOAST' }, allowMultiple: true } as export const GalleryUploadButton = () => { const uploadApi = useImageUploadButton(options); + const maxImageUploadCount = useAppSelector(selectMaxImageUploadCount); return ( <> 1 + ? t('accessibility.uploadImages') + : t('accessibility.uploadImage') + } + tooltip={ + maxImageUploadCount === undefined || maxImageUploadCount > 1 + ? t('accessibility.uploadImages') + : t('accessibility.uploadImage') + } icon={} {...uploadApi.getUploadButtonProps()} />