Move useEffect hook in src/App.jsx
This commit is contained in:
12
src/App.jsx
12
src/App.jsx
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user