Move useEffect hook in src/App.jsx

This commit is contained in:
2026-03-19 21:10:48 +01:00
parent 3399661809
commit bc66329f3f

View File

@@ -789,12 +789,6 @@ async function regenerateFromIndex(index, overrideUserText = null) {
} catch {}
}, [chatLibrarySlug]);
useEffect(() => {
if (chatLibrarySlug && chatLibrary && !chatLibrary.states?.is_indexed) {
setChatLibrarySlug(null)
}
}, [chatLibrarySlug, chatLibrary]);
useEffect(() => {
if (!ollamaApiUrl) return;
const interval = setInterval(() => {
@@ -831,6 +825,12 @@ async function regenerateFromIndex(index, overrideUserText = null) {
return libraries.find(lib => lib.slug === chatLibrarySlug) || null;
}, [chatLibrarySlug, libraries]);
useEffect(() => {
if (chatLibrarySlug && chatLibrary && !chatLibrary.states?.is_indexed) {
setChatLibrarySlug(null)
}
}, [chatLibrarySlug, chatLibrary]);
// Persist the scrollTop of the session we are LEAVING (on chat change or when leaving the chat view)
useEffect(() => {
const leavingSessionId = activeSessionId;