diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 248e1ff..d4b772e 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -366,6 +366,7 @@ function App() { return; setGeneratedCode(appHistory[index].code); }} + shouldDisableReverts={appState === AppState.CODING} /> } diff --git a/frontend/src/components/HistoryDisplay.tsx b/frontend/src/components/HistoryDisplay.tsx index 0306cf1..58908f2 100644 --- a/frontend/src/components/HistoryDisplay.tsx +++ b/frontend/src/components/HistoryDisplay.tsx @@ -1,9 +1,11 @@ import { ScrollArea } from "@/components/ui/scroll-area"; import { History, HistoryItemType } from "../history_types"; +import toast from "react-hot-toast"; interface Props { history: History; revertToVersion: (version: number) => void; + shouldDisableReverts: boolean; } function displayHistoryItemType(itemType: HistoryItemType) { @@ -24,7 +26,11 @@ function displayHistoryItemType(itemType: HistoryItemType) { } } -export default function HistoryDisplay({ history, revertToVersion }: Props) { +export default function HistoryDisplay({ + history, + revertToVersion, + shouldDisableReverts, +}: Props) { return history.length === 0 ? null : (