frontend: type the index redirect target as an Href
Pedro Lucas Porcellis porcellis@eletrotupi.com · 12 days ago
de30833f4bea0b7563d9cabe9154e52407683e25 Browse filesParents
2e426dfChanged files
1
Additions
+2
Deletions
-2
frontend/app/index.tsx
1 -
import { Redirect } from "expo-router";
1 +
import { Redirect, type Href } from "expo-router";
2 2
import { useAuth } from "@/context/AuthContext";
3 3
import { ActivityIndicator, View } from "react-native";
4 4
5 5
export default function Index() {
6 6
const { isAuthenticated, isLoading, user } = useAuth();
7 -
let url = "/auth/login";
7 +
let url: Href = "/auth/login";
8 8
9 9
if (isLoading) {
10 10
return (
11 11
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
12 12
<ActivityIndicator size="large" />
22 22
}
23 23
}
24 24
25 25
return <Redirect href={url} />;
26 26
}