Merge main into sweep/color-thief-feature

This commit is contained in:
sweep-ai[bot] 2023-11-26 20:35:28 +00:00 committed by GitHub
commit eabb40dfad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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({

View File

@ -128,7 +128,7 @@ const [colors, setColors] = useState<string[]>([]);
// 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));
}
})