mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-25 19:37:29 +02:00
Add autorefresh for document sets page
This commit is contained in:
@@ -82,7 +82,7 @@ function Main({ documentSetId }: { documentSetId: number }) {
|
||||
ccPairs={ccPairs}
|
||||
userGroups={userGroups}
|
||||
onClose={() => {
|
||||
router.push("/admin/documents/sets");
|
||||
router.push(`/admin/documents/sets?u=${Date.now()}`);
|
||||
}}
|
||||
setPopup={setPopup}
|
||||
existingDocumentSet={documentSet}
|
||||
|
@@ -4,7 +4,9 @@ import useSWR, { mutate } from "swr";
|
||||
|
||||
export function useDocumentSets() {
|
||||
const url = "/api/manage/admin/document-set";
|
||||
const swrResponse = useSWR<DocumentSet[]>(url, errorHandlingFetcher);
|
||||
const swrResponse = useSWR<DocumentSet[]>(url, errorHandlingFetcher, {
|
||||
refreshInterval: 5000, // 5 seconds
|
||||
});
|
||||
|
||||
return {
|
||||
...swrResponse,
|
||||
|
@@ -50,7 +50,7 @@ function Main() {
|
||||
ccPairs={ccPairs}
|
||||
userGroups={userGroups}
|
||||
onClose={() => {
|
||||
router.push("/admin/documents/sets");
|
||||
router.push(`/admin/documents/sets?u=${Date.now()}`);
|
||||
}}
|
||||
setPopup={setPopup}
|
||||
/>
|
||||
|
@@ -42,7 +42,7 @@ const EditRow = ({ documentSet }: { documentSet: DocumentSet }) => {
|
||||
return (
|
||||
<div className="relative flex">
|
||||
{isSyncingTooltipOpen && (
|
||||
<div className="flex flex-nowrap absolute w-72 top-0 left-0 mt-8 border border-border bg-background px-3 py-2 rounded shadow-lg z-40">
|
||||
<div className="flex flex-nowrap absolute w-64 top-0 left-0 mt-8 border border-border bg-background px-3 py-2 rounded shadow-lg break-words z-40">
|
||||
<InfoIcon className="mt-1 flex flex-shrink-0 mr-2" /> Cannot update
|
||||
while syncing! Wait for the sync to finish, then try again.
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user