From 96658819f359994f37a6429fb915f353b674c319 Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Wed, 31 Jul 2024 09:53:21 -0400 Subject: [PATCH] fix issue with loading variants --- frontend/src/store/project-store.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/store/project-store.ts b/frontend/src/store/project-store.ts index 20516ae..d35ba14 100644 --- a/frontend/src/store/project-store.ts +++ b/frontend/src/store/project-store.ts @@ -72,6 +72,9 @@ export const useProjectStore = create((set) => ({ appendToVariant: (newTokens: string, index: number) => set((state) => { const newVariants = [...state.variants]; + while (newVariants.length <= index) { + newVariants.push(""); + } newVariants[index] += newTokens; return { variants: newVariants }; }),