feat(ui): add tooltip to clear intermediates button when disabled

This commit is contained in:
psychedelicious 2023-10-15 17:27:25 +11:00
parent d349e00965
commit e1d2d382cf
2 changed files with 5 additions and 1 deletions

View File

@ -1115,6 +1115,7 @@
"showProgressInViewer": "Show Progress Images in Viewer",
"ui": "User Interface",
"useSlidersForAll": "Use Sliders For All Options",
"clearIntermediatesDisabled": "Queue must be empty to clear intermediates",
"clearIntermediatesDesc1": "Clearing intermediates will reset your Canvas and ControlNet state.",
"clearIntermediatesDesc2": "Intermediate images are byproducts of generation, different from the result images in the gallery. Clearing intermediates will free disk space.",
"clearIntermediatesDesc3": "Your gallery images will not be deleted.",

View File

@ -3,12 +3,12 @@ import { useAppDispatch } from 'app/store/storeHooks';
import { controlAdaptersReset } from 'features/controlAdapters/store/controlAdaptersSlice';
import { useCallback, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useGetQueueStatusQuery } from 'services/api/endpoints/queue';
import IAIButton from '../../../../common/components/IAIButton';
import {
useClearIntermediatesMutation,
useGetIntermediatesCountQuery,
} from '../../../../services/api/endpoints/images';
import { useGetQueueStatusQuery } from 'services/api/endpoints/queue';
import { resetCanvas } from '../../../canvas/store/canvasSlice';
import { addToast } from '../../store/systemSlice';
import StyledFlex from './StyledFlex';
@ -64,6 +64,9 @@ export default function SettingsClearIntermediates() {
<StyledFlex>
<Heading size="sm">{t('settings.clearIntermediates')}</Heading>
<IAIButton
tooltip={
hasPendingItems ? t('settings.clearIntermediatesDisabled') : undefined
}
colorScheme="warning"
onClick={handleClickClearIntermediates}
isLoading={isLoadingClearIntermediates}