redo reverts code (when possible) (#75)

This commit is contained in:
Will Chen
2025-05-02 14:55:46 -07:00
committed by GitHub
parent 5fc49231ee
commit 46cb7ca577
4 changed files with 49 additions and 2 deletions

View File

@@ -53,6 +53,7 @@ import {
TooltipTrigger,
} from "../ui/tooltip";
import { useNavigate } from "@tanstack/react-router";
import { useVersions } from "@/hooks/useVersions";
const showTokenBarAtom = atom(false);
@@ -61,6 +62,8 @@ export function ChatInput({ chatId }: { chatId?: number }) {
const [inputValue, setInputValue] = useAtom(chatInputValueAtom);
const textareaRef = useRef<HTMLTextAreaElement>(null);
const { settings, updateSettings, isAnyProviderSetup } = useSettings();
const appId = useAtomValue(selectedAppIdAtom);
const { refreshVersions } = useVersions(appId);
const { streamMessage, isStreaming, setIsStreaming, error, setError } =
useStreamChat();
const [showError, setShowError] = useState(true);
@@ -162,6 +165,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
} finally {
setIsApproving(false);
setIsPreviewOpen(true);
refreshVersions();
// Keep same as handleReject
refreshProposal();