mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-01 02:30:18 +02:00
ensure all timeout -> hook (#2718)
This commit is contained in:
parent
79d37156c6
commit
a0124e4e50
@ -50,14 +50,8 @@ function Main({ ccPairId }: { ccPairId: number }) {
|
||||
const { popup, setPopup } = usePopup();
|
||||
|
||||
const finishConnectorDeletion = useCallback(() => {
|
||||
setPopup({
|
||||
message: "Connector deleted successfully",
|
||||
type: "success",
|
||||
});
|
||||
setTimeout(() => {
|
||||
router.push("/admin/indexing/status");
|
||||
}, 2000);
|
||||
}, [router, setPopup]);
|
||||
router.push("/admin/indexing/status?message=connector-deleted");
|
||||
}, [router]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isEditing && inputRef.current) {
|
||||
@ -80,14 +74,7 @@ function Main({ ccPairId }: { ccPairId: number }) {
|
||||
) {
|
||||
finishConnectorDeletion();
|
||||
}
|
||||
}, [
|
||||
isLoading,
|
||||
ccPair,
|
||||
error,
|
||||
hasLoadedOnce,
|
||||
router,
|
||||
finishConnectorDeletion,
|
||||
]);
|
||||
}, [isLoading, ccPair, error, hasLoadedOnce]);
|
||||
|
||||
const handleNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setEditableName(e.target.value);
|
||||
|
@ -10,12 +10,6 @@ import { useConnectorCredentialIndexingStatus } from "@/lib/hooks";
|
||||
import { usePopupFromQuery } from "@/components/popup/PopupFromQuery";
|
||||
|
||||
function Main() {
|
||||
const { popup } = usePopupFromQuery({
|
||||
"connector-created": {
|
||||
message: "Connector created successfully",
|
||||
type: "success",
|
||||
},
|
||||
});
|
||||
const {
|
||||
data: indexAttemptData,
|
||||
isLoading: indexAttemptIsLoading,
|
||||
@ -70,19 +64,28 @@ function Main() {
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
{popup}
|
||||
<CCPairIndexingStatusTable
|
||||
ccPairsIndexingStatuses={indexAttemptData}
|
||||
editableCcPairsIndexingStatuses={editableIndexAttemptData}
|
||||
/>
|
||||
</>
|
||||
<CCPairIndexingStatusTable
|
||||
ccPairsIndexingStatuses={indexAttemptData}
|
||||
editableCcPairsIndexingStatuses={editableIndexAttemptData}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Status() {
|
||||
const { popup } = usePopupFromQuery({
|
||||
"connector-created": {
|
||||
message: "Connector created successfully",
|
||||
type: "success",
|
||||
},
|
||||
"connector-deleted": {
|
||||
message: "Connector deleted successfully",
|
||||
type: "success",
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="mx-auto container">
|
||||
{popup}
|
||||
<AdminPageTitle
|
||||
icon={<NotebookIcon size={32} />}
|
||||
title="Existing Connectors"
|
||||
|
Loading…
x
Reference in New Issue
Block a user