From a1df31e142dc41f8e58b6ec51fb7f05c5aaab49f Mon Sep 17 00:00:00 2001 From: Sir Blob <76974209+GamerBoss101@users.noreply.github.com> Date: Sun, 26 Jan 2025 03:02:37 -0500 Subject: [PATCH] logic changes --- src/app/(panels)/suite/layout.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/(panels)/suite/layout.jsx b/src/app/(panels)/suite/layout.jsx index a78e6ee..c0a56b1 100644 --- a/src/app/(panels)/suite/layout.jsx +++ b/src/app/(panels)/suite/layout.jsx @@ -22,10 +22,10 @@ export default function RootLayout({ }, [user]); if (userData) { - if (userData.role === "caregiver") { + if (userData.role === "caregiver" && router.pathname.startsWith("/suite/patient/")) { router.push("/suite/doctor/dashboard"); } - if (userData.role === "patient") { + if (userData.role === "patient" && router.pathname.startsWith("/suite/doctor/")) { router.push("/suite/patient/dashboard"); } }