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,
|
useClearIntermediatesMutation,
|
||||||
useGetIntermediatesCountQuery,
|
useGetIntermediatesCountQuery,
|
||||||
} from '../../../../services/api/endpoints/images';
|
} from '../../../../services/api/endpoints/images';
|
||||||
|
import { useGetQueueStatusQuery } from 'services/api/endpoints/queue';
|
||||||
import { resetCanvas } from '../../../canvas/store/canvasSlice';
|
import { resetCanvas } from '../../../canvas/store/canvasSlice';
|
||||||
import { addToast } from '../../store/systemSlice';
|
import { addToast } from '../../store/systemSlice';
|
||||||
import StyledFlex from './StyledFlex';
|
import StyledFlex from './StyledFlex';
|
||||||
@ -22,7 +23,14 @@ export default function SettingsClearIntermediates() {
|
|||||||
const [clearIntermediates, { isLoading: isLoadingClearIntermediates }] =
|
const [clearIntermediates, { isLoading: isLoadingClearIntermediates }] =
|
||||||
useClearIntermediatesMutation();
|
useClearIntermediatesMutation();
|
||||||
|
|
||||||
|
const { data: queueStatus } = useGetQueueStatusQuery();
|
||||||
|
const hasPendingItems = queueStatus && (queueStatus.in_progress > 0 || queueStatus.pending > 0);
|
||||||
|
|
||||||
const handleClickClearIntermediates = useCallback(() => {
|
const handleClickClearIntermediates = useCallback(() => {
|
||||||
|
if (hasPendingItems) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
clearIntermediates()
|
clearIntermediates()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.then((clearedCount) => {
|
.then((clearedCount) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user