Files
lst_v3/lstMobile/src/app/index.tsx
Blake Matthes ba30281e59
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
feat(mobile): auth added in
2026-05-06 05:07:16 -05:00

33 lines
914 B
TypeScript

import { Redirect } from "expo-router";
import { ActivityIndicator, Text, View } from "react-native";
import { useAppStartup } from "../hooks/useAppStartup";
const startupMessages = {
loading: "Loading app...",
validating: "Validating data...",
scannerMode: "Checking scanner mode...",
normalScanner: "Starting normal ALPLAprod scanner that has no LST rules",
checkingUpdates: "Checking for updates...",
opening: "Opening LST scan app...",
error: "Something went wrong during startup.",
};
export default function Index() {
const { ready, startupRoute, status } = useAppStartup();
if (ready && startupRoute) {
return <Redirect href={startupRoute as any} />;
}
if (ready) {
return <Redirect href="/login" />;
}
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Text>{startupMessages[status]}</Text>
<ActivityIndicator size="large" />
</View>
);
}