Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

fix bug with handling setCode

Abi Rajaf52ca306a57a
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index e88fa284..789b905a 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -189,8 +189,11 @@ function App() {
},
// On set code
(code, variant) => {
+ if (variant === currentVariantIndex) {
+ setGeneratedCode(code);
+ }
+
setVariant(code, variant);
- setGeneratedCode(code);
// TODO: How to deal with variants?
if (params.generationType === "create") {