diff --git a/src/app/(dashboard)/jobs/[jobId]/components/job-actions-panel.tsx b/src/app/(dashboard)/jobs/[jobId]/components/job-actions-panel.tsx index a5744a6..61d8bba 100644 --- a/src/app/(dashboard)/jobs/[jobId]/components/job-actions-panel.tsx +++ b/src/app/(dashboard)/jobs/[jobId]/components/job-actions-panel.tsx @@ -1,7 +1,6 @@ "use client"; import { useActionState, useEffect, useState } from "react"; -import { useRouter } from "next/navigation"; import { ArrowRight, Check, @@ -87,17 +86,13 @@ export function JobActionsPanel({ } function AcceptButton({ jobId }: { jobId: string }) { - const router = useRouter(); const [state, action, pending] = useActionState(acceptJobAction, initialJobActionState); useEffect(() => { - if (state.ok) { - toast.success("İş işleme alındı, alt yapı üretimi başladı."); - router.refresh(); - } else if (state.error) { - toast.error(state.error); - } - }, [state, router]); + // Success path redirects from the server action, so state.ok never + // shows up here — we only need to surface errors. + if (state.error) toast.error(state.error); + }, [state]); return (