diff --git a/src/app/(dashboard)/connections/components/connections-table.tsx b/src/app/(dashboard)/connections/components/connections-table.tsx index f0c0dab..a6652ff 100644 --- a/src/app/(dashboard)/connections/components/connections-table.tsx +++ b/src/app/(dashboard)/connections/components/connections-table.tsx @@ -1,7 +1,8 @@ "use client"; import * as React from "react"; -import { useActionState, useEffect, useState, useTransition } from "react"; +import { useActionState, useEffect, useState } from "react"; +import { useRouter } from "next/navigation"; import { Loader2, Trash2 } from "lucide-react"; import { toast } from "sonner"; @@ -108,17 +109,18 @@ function ApprovedRow({ deleteConnectionAction, initialConnectionActionState, ); - const [, startTransition] = useTransition(); + const router = useRouter(); const [open, setOpen] = useState(false); useEffect(() => { if (state.ok) { toast.success("Bağlantı silindi."); setOpen(false); + router.refresh(); } else if (state.error) { toast.error(state.error); } - }, [state]); + }, [state, router]); const kindLabel = row.counterpart?.kind === "lab" @@ -190,11 +192,7 @@ function ApprovedRow({ -
{ - startTransition(() => action(fd)); - }} - > +
-
{ - startTransition(() => rejectAction(fd)); - }} - > + - { - startTransition(() => action(fd)); - }} - > +