From 83f6f00b108ec5c172aee4c362d28fe6c78317f7 Mon Sep 17 00:00:00 2001 From: Abi Raja Date: Thu, 25 Jul 2024 12:33:31 -0400 Subject: [PATCH] also use currentVersion --- frontend/src/App.tsx | 4 ++-- frontend/src/store/project-store.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index fa0b485..c85c09f 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -56,6 +56,8 @@ function App() { setReferenceImages, generatedCode, setGeneratedCode, + currentVersion, + setCurrentVersion, } = useProjectStore(); const [executionConsole, setExecutionConsole] = useState([]); @@ -88,8 +90,6 @@ function App() { // App history const [appHistory, setAppHistory] = useState([]); - // Tracks the currently shown version from app history - const [currentVersion, setCurrentVersion] = useState(null); const [shouldIncludeResultImage, setShouldIncludeResultImage] = useState(false); diff --git a/frontend/src/store/project-store.ts b/frontend/src/store/project-store.ts index 4b2c547..ec2510f 100644 --- a/frontend/src/store/project-store.ts +++ b/frontend/src/store/project-store.ts @@ -16,8 +16,12 @@ interface ProjectStore { setGeneratedCode: ( updater: string | ((currentCode: string) => string) ) => void; + + // Tracks the currently shown version from app history + // TODO: might want to move to appStore currentVersion: number | null; setCurrentVersion: (version: number | null) => void; + appHistory: History[]; setAppHistory: (history: History[]) => void; }