Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion frontend/src/pages/GeneralSettings/VectorDatabase/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,17 @@ export default function GeneralVectorDatabase() {
},
];

const selectedVDBObject = VECTOR_DBS.find((vdb) => vdb.value === selectedVDB);
const selectedVDBObject =
VECTOR_DBS.find((vdb) => vdb.value === selectedVDB) || VECTOR_DBS[0];

useEffect(() => {
if (selectedVDB && !VECTOR_DBS.some((vdb) => vdb.value === selectedVDB)) {
showToast(`Failed to select vector database: ${selectedVDB}`, "error");
console.error(`Failed to select vector database: ${selectedVDB}`);
setSelectedVDB(selectedVDBObject.value);
setHasChanges(true);
}
}, [selectedVDB]);

return (
<div className="w-screen h-screen overflow-hidden bg-theme-bg-container flex">
Expand Down