Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0db8a20

Browse files
committed
disable variants for video
1 parent c1fc286 commit 0db8a20

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

frontend/src/App.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,15 @@ function App() {
212212
wsRef,
213213
updatedParams,
214214
// On change
215-
(token, variant) => {
216-
appendCommitCode(commit.hash, variant, token);
215+
(token, variantIndex) => {
216+
appendCommitCode(commit.hash, variantIndex, token);
217217
},
218218
// On set code
219-
(code, variant) => {
220-
setCommitCode(commit.hash, variant, code);
219+
(code, variantIndex) => {
220+
setCommitCode(commit.hash, variantIndex, code);
221221
},
222222
// On status update
223-
(line, variant) => appendExecutionConsole(variant, line),
223+
(line, variantIndex) => appendExecutionConsole(variantIndex, line),
224224
// On cancel
225225
() => {
226226
cancelCodeGenerationAndReset(commit);

frontend/src/components/variants/Variants.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useProjectStore } from "../../store/project-store";
22

33
function Variants() {
4-
const { head, commits, updateSelectedVariantIndex } = useProjectStore();
4+
const { inputMode, head, commits, updateSelectedVariantIndex } =
5+
useProjectStore();
56

67
// If there is no head, don't show the variants
78
if (head === null) {
@@ -13,7 +14,7 @@ function Variants() {
1314
const selectedVariantIndex = commit.selectedVariantIndex;
1415

1516
// If there is only one variant or the commit is already committed, don't show the variants
16-
if (variants.length <= 1 || commit.isCommitted) {
17+
if (variants.length <= 1 || commit.isCommitted || inputMode === "video") {
1718
return <div className="mt-2"></div>;
1819
}
1920

0 commit comments

Comments
 (0)