feat(intial auth): intial auth setup for the scanner
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
This commit is contained in:
@@ -4,6 +4,7 @@ import { Redirect, useRouter } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { ActivityIndicator, Text, View } from "react-native";
|
||||
import { useAppStore } from "../hooks/useAppStore";
|
||||
import { useMobileAuthStore } from "../hooks/useMobileAuth";
|
||||
import { useServerStore } from "../hooks/useServerCheck";
|
||||
import { devDelay } from "../lib/devMode";
|
||||
|
||||
@@ -12,6 +13,7 @@ export default function Index() {
|
||||
const [message, setMessage] = useState(<Text>Starting app...</Text>);
|
||||
const [ready, setReady] = useState(false);
|
||||
const setServerVersion = useServerStore((s) => s.setServerVersion);
|
||||
//const { isUnlocked } = useMobileAuthStore();
|
||||
|
||||
const hasHydrated = useAppStore((s) => s.hasHydrated);
|
||||
const serverPort = useAppStore((s) => s.serverPort);
|
||||
@@ -86,7 +88,7 @@ export default function Index() {
|
||||
// TODO if theres an update go to update screen message :D
|
||||
setMessage(<Text>Opening LST scan app</Text>);
|
||||
await devDelay(3250);
|
||||
//router.replace("/scanner");
|
||||
|
||||
setReady(true);
|
||||
} catch (error) {
|
||||
console.log("Startup error", error);
|
||||
@@ -104,6 +106,9 @@ export default function Index() {
|
||||
setServerVersion,
|
||||
]);
|
||||
|
||||
// if (ready && !isUnlocked) {
|
||||
// return <Redirect href={"/login"} />;
|
||||
// }
|
||||
if (ready) {
|
||||
return <Redirect href="/(tabs)/scanner" />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user