Update library handling logic in App.jsx

This commit is contained in:
2026-03-19 21:23:38 +01:00
parent c5d1510423
commit 0188ccb117

View File

@@ -697,6 +697,7 @@ async function regenerateFromIndex(index, overrideUserText = null) {
if (nextLibraries.length === 0) {
setActiveLibrarySlug(null);
setChatLibrarySlug(null);
setPendingChatLibrarySlug(null);
return;
}
@@ -706,6 +707,9 @@ async function regenerateFromIndex(index, overrideUserText = null) {
if (chatLibrarySlug && !nextLibraries.some(lib => lib.slug === chatLibrarySlug)) {
setChatLibrarySlug(null);
}
if (pendingChatLibrarySlug && !nextLibraries.some(lib => lib.slug === pendingChatLibrarySlug)) {
setPendingChatLibrarySlug(null);
}
} catch (error) {
console.warn('Failed to load libraries', error);
}