clear canvas alongside intermediates

This commit is contained in:
Mary Hipp 2023-07-19 11:02:33 -04:00 committed by Kent Keirsey
parent 9f00e055ac
commit 055f5b2d4b

View File

@ -5,6 +5,7 @@ import { Heading, Text } from '@chakra-ui/react';
import IAIButton from '../../../../common/components/IAIButton'; import IAIButton from '../../../../common/components/IAIButton';
import { useClearIntermediatesMutation } from '../../../../services/api/endpoints/images'; import { useClearIntermediatesMutation } from '../../../../services/api/endpoints/images';
import { addToast } from '../../store/systemSlice'; import { addToast } from '../../store/systemSlice';
import { resetCanvas } from '../../../canvas/store/canvasSlice';
export default function SettingsClearIntermediates() { export default function SettingsClearIntermediates() {
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
@ -17,6 +18,7 @@ export default function SettingsClearIntermediates() {
clearIntermediates({}) clearIntermediates({})
.unwrap() .unwrap()
.then((response) => { .then((response) => {
dispatch(resetCanvas());
dispatch( dispatch(
addToast({ addToast({
title: title:
@ -47,6 +49,7 @@ export default function SettingsClearIntermediates() {
Will permanently delete first 100 intermediates found on disk and in Will permanently delete first 100 intermediates found on disk and in
database database
</Text> </Text>
<Text fontWeight="bold">This will also clear your canvas state.</Text>
<Text> <Text>
Intermediate images are byproducts of generation, different from the Intermediate images are byproducts of generation, different from the
result images in the gallery. Purging intermediates will free disk result images in the gallery. Purging intermediates will free disk