From 8459ab183793c63a5fdc15acfbddb7bb34cff466 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Fri, 17 Apr 2026 10:50:12 +0200 Subject: [PATCH] Add model reference and update vision model check --- src/App.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App.jsx b/src/App.jsx index 7aa7e4c..fb11c5d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -396,6 +396,7 @@ export default function App() { const [isChatDragActive, setIsChatDragActive] = useState(false) const chatRef = useRef(null) const textareaRef = useRef(null); // Ref for the textarea + const modelRef = useRef(model) const dbPickerRef = useRef(null) const chatModelPickerRef = useRef(null) const imageInputRef = useRef(null) @@ -574,7 +575,7 @@ export default function App() { try { const data = await fetchModelCapabilities(nextModel) - if (!data?.supports_vision) { + if (!data?.supports_vision || modelRef.current !== nextModel) { return false } setVisionModel(nextModel) @@ -1381,6 +1382,10 @@ async function regenerateFromIndex(index, overrideUserText = null) { }; }, []); + useEffect(() => { + modelRef.current = model + }, [model]) + useEffect(() => { let cancelled = false const controller = new AbortController()