import { AlertDialog, AlertDialogBody, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, Button, useDisclosure, } from '@chakra-ui/react'; import { emptyTempFolder } from 'app/socketio/actions'; import { useAppDispatch } from 'app/store'; import IAIButton from 'common/components/IAIButton'; import { clearCanvasHistory, resetCanvas, } from 'features/canvas/store/canvasSlice'; import { useRef } from 'react'; import { FaTrash } from 'react-icons/fa'; const ClearTempFolderButtonModal = () => { const dispatch = useAppDispatch(); const { isOpen, onOpen, onClose } = useDisclosure(); const cancelRef = useRef(null); const handleClear = () => { dispatch(emptyTempFolder()); dispatch(clearCanvasHistory()); dispatch(resetCanvas()); onClose(); }; return ( <> } size={'sm'} onClick={onOpen}> Clear Temp Image Folder Clear Temp Image Folder

Clearing the temp image folder also fully resets the Unified Canvas. This includes all undo/redo history, images in the staging area, and the canvas base layer.


Are you sure you want to clear the temp folder?

); }; export default ClearTempFolderButtonModal;