diff --git a/app/(dashboard)/proxy-hosts/ProxyHostsClient.tsx b/app/(dashboard)/proxy-hosts/ProxyHostsClient.tsx index d691a0aa..84235985 100644 --- a/app/(dashboard)/proxy-hosts/ProxyHostsClient.tsx +++ b/app/(dashboard)/proxy-hosts/ProxyHostsClient.tsx @@ -1,7 +1,6 @@ "use client"; import { useMemo, useState, useEffect } from "react"; -import { useRouter } from "next/navigation"; import { Alert, Box, @@ -250,15 +249,14 @@ function CreateHostDialog({ certificates: Certificate[]; accessLists: AccessList[]; }) { - const router = useRouter(); const [state, formAction] = useFormState(createProxyHostAction, INITIAL_ACTION_STATE); useEffect(() => { if (state.status === "success") { - router.refresh(); + // revalidatePath in server action already handles the refresh setTimeout(onClose, 1000); } - }, [state.status, router, onClose]); + }, [state.status, onClose]); return ( { if (state.status === "success") { - router.refresh(); + // revalidatePath in server action already handles the refresh setTimeout(onClose, 1000); } - }, [state.status, router, onClose]); + }, [state.status, onClose]); return ( void; }) { - const router = useRouter(); const [state, formAction] = useFormState(deleteProxyHostAction.bind(null, host.id), INITIAL_ACTION_STATE); useEffect(() => { if (state.status === "success") { - router.refresh(); + // revalidatePath in server action already handles the refresh setTimeout(onClose, 1000); } - }, [state.status, router, onClose]); + }, [state.status, onClose]); return (