refactor(mobile): more look and feel work
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m17s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m17s
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import axios from "axios";
|
||||
import { Redirect, useRouter } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { ActivityIndicator, Text, View } from "react-native";
|
||||
@@ -11,6 +12,7 @@ export default function Index() {
|
||||
|
||||
const hasHydrated = useAppStore((s) => s.hasHydrated);
|
||||
const serverPort = useAppStore((s) => s.serverPort);
|
||||
const serverIp = useAppStore((s) => s.serverIp);
|
||||
const hasValidSetup = useAppStore((s) => s.hasValidSetup);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -31,6 +33,23 @@ export default function Index() {
|
||||
return;
|
||||
}
|
||||
|
||||
// checking for lst.
|
||||
console.log(
|
||||
`http://${serverIp}:${parseInt(serverPort || "0", 10) >= 50000 ? "3000" : serverPort}/lst/api/mobile/version`,
|
||||
);
|
||||
try {
|
||||
const res = await axios.get(
|
||||
`http://${serverIp}:${parseInt(serverPort || "0", 10) >= 50000 ? "3000" : serverPort}/lst/api/mobile/version`,
|
||||
{
|
||||
timeout: 5000,
|
||||
},
|
||||
);
|
||||
|
||||
console.log(res.data);
|
||||
} catch (error) {
|
||||
console.log("Error: ", error);
|
||||
}
|
||||
|
||||
setMessage(<Text>Checking scanner mode...</Text>);
|
||||
await devDelay(1500);
|
||||
|
||||
@@ -60,7 +79,7 @@ export default function Index() {
|
||||
};
|
||||
|
||||
startup();
|
||||
}, [hasHydrated, hasValidSetup, serverPort, router]);
|
||||
}, [hasHydrated, hasValidSetup, serverPort, serverIp, router]);
|
||||
|
||||
if (ready) {
|
||||
return <Redirect href="/(tabs)/scanner" />;
|
||||
|
||||
Reference in New Issue
Block a user