fix issue with loading variants

This commit is contained in:
Abi Raja 2024-07-31 09:53:21 -04:00
parent 24a123db36
commit 96658819f3

View File

@ -72,6 +72,9 @@ export const useProjectStore = create<ProjectStore>((set) => ({
appendToVariant: (newTokens: string, index: number) => appendToVariant: (newTokens: string, index: number) =>
set((state) => { set((state) => {
const newVariants = [...state.variants]; const newVariants = [...state.variants];
while (newVariants.length <= index) {
newVariants.push("");
}
newVariants[index] += newTokens; newVariants[index] += newTokens;
return { variants: newVariants }; return { variants: newVariants };
}), }),