diff --git a/frontend/src/components/SourcesPopup.tsx b/frontend/src/components/SourcesPopup.tsx index 6846cf84..83966730 100644 --- a/frontend/src/components/SourcesPopup.tsx +++ b/frontend/src/components/SourcesPopup.tsx @@ -81,12 +81,6 @@ export default function SourcesPopup({ return () => window.removeEventListener('resize', updatePosition); }, [isOpen, anchorRef]); - const handleEmptyDocumentSelect = () => { - dispatch(setSelectedDocs(null)); - handlePostDocumentSelect(null); - onClose(); - }; - const handleClickOutside = (event: MouseEvent) => { if ( popupRef.current && @@ -153,14 +147,24 @@ export default function SourcesPopup({ <> {filteredOptions?.map((option: any, index: number) => { if (option.model === embeddingsName) { + const isSelected = + selectedDocs && + (option.id + ? selectedDocs.id === option.id + : selectedDocs.date === option.date); + return (