From b43ddcbea2e39060bf936713953bea087961990f Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Tue, 5 Sep 2023 09:29:47 +0000 Subject: [PATCH] refactor: redirect using useRouter --- apps/web/src/app/(share)/share/[shareId]/redirect.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/(share)/share/[shareId]/redirect.tsx b/apps/web/src/app/(share)/share/[shareId]/redirect.tsx index 6846975cb..f64095608 100644 --- a/apps/web/src/app/(share)/share/[shareId]/redirect.tsx +++ b/apps/web/src/app/(share)/share/[shareId]/redirect.tsx @@ -2,10 +2,14 @@ import { useEffect } from 'react'; +import { useRouter } from 'next/navigation'; + export default function Redirect() { + const router = useRouter(); + useEffect(() => { const timer = setTimeout(() => { - window.location.href = 'https://www.documenso.com'; + router.push('/'); }, 3000); return () => clearTimeout(timer);