mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fixed bug #4857
This commit is contained in:
parent
bba962b82f
commit
c3d6ff5b11
@ -8,6 +8,7 @@ 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';
|
||||
@ -22,7 +23,14 @@ export default function SettingsClearIntermediates() {
|
||||
const [clearIntermediates, { isLoading: isLoadingClearIntermediates }] =
|
||||
useClearIntermediatesMutation();
|
||||
|
||||
const { data: queueStatus } = useGetQueueStatusQuery();
|
||||
const hasPendingItems = queueStatus && (queueStatus.in_progress > 0 || queueStatus.pending > 0);
|
||||
|
||||
const handleClickClearIntermediates = useCallback(() => {
|
||||
if (hasPendingItems) {
|
||||
return;
|
||||
}
|
||||
|
||||
clearIntermediates()
|
||||
.unwrap()
|
||||
.then((clearedCount) => {
|
||||
|
Loading…
Reference in New Issue
Block a user