From f52ca306a57a76a9daf00fd7077765944367e394 Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Tue, 30 Jul 2024 16:09:02 -0400 Subject: [PATCH] fix bug with handling setCode --- frontend/src/App.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index e88fa28..789b905 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") {