logic changes

This commit is contained in:
Sir Blob
2025-01-26 03:02:37 -05:00
parent 4a29e300cf
commit a1df31e142

View File

@@ -22,10 +22,10 @@ export default function RootLayout({
}, [user]); }, [user]);
if (userData) { if (userData) {
if (userData.role === "caregiver") { if (userData.role === "caregiver" && router.pathname.startsWith("/suite/patient/")) {
router.push("/suite/doctor/dashboard"); router.push("/suite/doctor/dashboard");
} }
if (userData.role === "patient") { if (userData.role === "patient" && router.pathname.startsWith("/suite/doctor/")) {
router.push("/suite/patient/dashboard"); router.push("/suite/patient/dashboard");
} }
} }