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