diff --git a/frontend/src/modals/ChunkModal.tsx b/frontend/src/modals/ChunkModal.tsx index 4e229980..cf6d1896 100644 --- a/frontend/src/modals/ChunkModal.tsx +++ b/frontend/src/modals/ChunkModal.tsx @@ -33,6 +33,19 @@ export default function ChunkModal({ setChunkText(originalText || ''); }, [originalTitle, originalText]); + const resetForm = () => { + setTitle(''); + setChunkText(''); + }; + + const handleDeleteConfirmed = () => { + if (handleDelete) { + handleDelete(); + } + setDeleteModal('INACTIVE'); + setModalState('INACTIVE'); + }; + if (modalState !== 'ACTIVE') return null; const content = ( @@ -71,6 +84,7 @@ export default function ChunkModal({ onClick={() => { handleSubmit(title, chunkText); setModalState('INACTIVE'); + resetForm(); }} className="rounded-3xl bg-purple-30 px-5 py-2 text-sm text-white transition-all hover:bg-violets-are-blue" > @@ -79,6 +93,7 @@ export default function ChunkModal({