diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 72c0d57a..324d5aa0 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -34,10 +34,12 @@ import { selectSelectedDocs, selectSelectedDocsStatus, selectSourceDocs, + selectPaginatedDocuments, setConversations, setModalStateDeleteConv, setSelectedDocs, setSourceDocs, + setPaginatedDocuments, } from './preferences/preferenceSlice'; import Spinner from './assets/spinner.svg'; import SpinnerDark from './assets/spinner-dark.svg'; @@ -72,6 +74,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { const conversations = useSelector(selectConversations); const modalStateDeleteConv = useSelector(selectModalStateDeleteConv); const conversationId = useSelector(selectConversationId); + const paginatedDocuments = useSelector(selectPaginatedDocuments); const [isDeletingConversation, setIsDeletingConversation] = useState(false); const { isMobile } = useMediaQuery(); @@ -143,6 +146,12 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { }) .then((updatedDocs) => { dispatch(setSourceDocs(updatedDocs)); + const updatedPaginatedDocs = paginatedDocuments?.filter( + (document) => document.id !== doc.id, + ); + dispatch( + setPaginatedDocuments(updatedPaginatedDocs || paginatedDocuments), + ); dispatch( setSelectedDocs( Array.isArray(updatedDocs) && diff --git a/frontend/src/components/DocumentPagination.tsx b/frontend/src/components/DocumentPagination.tsx index 3edeff9d..b0532362 100644 --- a/frontend/src/components/DocumentPagination.tsx +++ b/frontend/src/components/DocumentPagination.tsx @@ -48,10 +48,14 @@ const Pagination: React.FC = ({