Skip to content

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

Python

disable variants for video

Abi Raja0db8a206f25b
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 75ce17ee..d5dca0cd 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -212,15 +212,15 @@ function App() {
wsRef,
updatedParams,
// On change
- (token, variant) => {
- appendCommitCode(commit.hash, variant, token);
+ (token, variantIndex) => {
+ appendCommitCode(commit.hash, variantIndex, token);
},
// On set code
- (code, variant) => {
- setCommitCode(commit.hash, variant, code);
+ (code, variantIndex) => {
+ setCommitCode(commit.hash, variantIndex, code);
},
// On status update
- (line, variant) => appendExecutionConsole(variant, line),
+ (line, variantIndex) => appendExecutionConsole(variantIndex, line),
// On cancel
() => {
cancelCodeGenerationAndReset(commit);
diff --git a/frontend/src/components/variants/Variants.tsx b/frontend/src/components/variants/Variants.tsx
index 6b6ce8f8..9f97f0be 100644
--- a/frontend/src/components/variants/Variants.tsx
+++ b/frontend/src/components/variants/Variants.tsx
@@ -1,7 +1,8 @@
import { useProjectStore } from "../../store/project-store";
function Variants() {
- const { head, commits, updateSelectedVariantIndex } = useProjectStore();
+ const { inputMode, head, commits, updateSelectedVariantIndex } =
+ useProjectStore();
// If there is no head, don't show the variants
if (head === null) {
@@ -13,7 +14,7 @@ function Variants() {
const selectedVariantIndex = commit.selectedVariantIndex;
// If there is only one variant or the commit is already committed, don't show the variants
- if (variants.length <= 1 || commit.isCommitted) {
+ if (variants.length <= 1 || commit.isCommitted || inputMode === "video") {
return <div className="mt-2"></div>;
}