diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4c843d6..529283c 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -116,6 +116,9 @@ function App() { // Initial version creation function doCreate(referenceImages: string[]) { + // Reset any existing state + reset(); + setReferenceImages(referenceImages); if (referenceImages.length > 0) { doGenerateCode({ diff --git a/frontend/src/components/ImageUpload.tsx b/frontend/src/components/ImageUpload.tsx index d1b7f03..22d19e6 100644 --- a/frontend/src/components/ImageUpload.tsx +++ b/frontend/src/components/ImageUpload.tsx @@ -128,7 +128,7 @@ const [colors, setColors] = useState([]); // Convert images to data URLs and set the prompt images state Promise.all(files.map((file) => fileToDataURL(file))) .then((dataUrls) => { - if(dataUrls.length > 0) { + if (dataUrls.length > 0) { setReferenceImages(dataUrls.map((dataUrl) => dataUrl as string)); } })