disable variants for video

This commit is contained in:
Abi Raja 2024-08-31 15:47:44 +02:00
parent c1fc28624d
commit 0db8a206f2
2 changed files with 8 additions and 7 deletions

View File

@ -212,15 +212,15 @@ function App() {
wsRef, wsRef,
updatedParams, updatedParams,
// On change // On change
(token, variant) => { (token, variantIndex) => {
appendCommitCode(commit.hash, variant, token); appendCommitCode(commit.hash, variantIndex, token);
}, },
// On set code // On set code
(code, variant) => { (code, variantIndex) => {
setCommitCode(commit.hash, variant, code); setCommitCode(commit.hash, variantIndex, code);
}, },
// On status update // On status update
(line, variant) => appendExecutionConsole(variant, line), (line, variantIndex) => appendExecutionConsole(variantIndex, line),
// On cancel // On cancel
() => { () => {
cancelCodeGenerationAndReset(commit); cancelCodeGenerationAndReset(commit);

View File

@ -1,7 +1,8 @@
import { useProjectStore } from "../../store/project-store"; import { useProjectStore } from "../../store/project-store";
function Variants() { function Variants() {
const { head, commits, updateSelectedVariantIndex } = useProjectStore(); const { inputMode, head, commits, updateSelectedVariantIndex } =
useProjectStore();
// If there is no head, don't show the variants // If there is no head, don't show the variants
if (head === null) { if (head === null) {
@ -13,7 +14,7 @@ function Variants() {
const selectedVariantIndex = commit.selectedVariantIndex; const selectedVariantIndex = commit.selectedVariantIndex;
// If there is only one variant or the commit is already committed, don't show the variants // 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>; return <div className="mt-2"></div>;
} }