fix: redirect when intro modal first time

This commit is contained in:
Fredrik Burmester
2026-01-09 15:44:10 +01:00
parent 241f8c949a
commit 7514bc2c2c
5 changed files with 20 additions and 31 deletions

View File

@@ -574,10 +574,8 @@ function useProtectedRoute(user: UserDto | null, loaded = false) {
const inAuthGroup = segments.length > 1 && segments[0] === "(auth)";
if (!user?.Id && inAuthGroup) {
console.log("Redirected to login");
router.replace("/login");
} else if (user?.Id && !inAuthGroup) {
console.log("Redirected to home");
router.replace("/(auth)/(tabs)/(home)/");
}
}, [user, segments, loaded]);