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,
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);

View File

@ -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>;
}