From 20fc2860690f59851ca1e0251df84854c9d2ba01 Mon Sep 17 00:00:00 2001 From: blake Date: Sun, 16 Nov 2025 20:21:08 -0600 Subject: [PATCH] test(mobile): stallion intergration starts --- mobileLst/app/index.tsx | 87 +- mobileLst/babel.config.js | 17 + mobileLst/metro.config.ts | 12 + mobileLst/package-lock.json | 1866 +++++++++++- mobileLst/package.json | 4 + package-lock.json | 5757 ++++++++++++++++++++++++++++++++++- package.json | 4 + 7 files changed, 7667 insertions(+), 80 deletions(-) create mode 100644 mobileLst/babel.config.js create mode 100644 mobileLst/metro.config.ts diff --git a/mobileLst/app/index.tsx b/mobileLst/app/index.tsx index 1da4d61..8732cd5 100644 --- a/mobileLst/app/index.tsx +++ b/mobileLst/app/index.tsx @@ -1,3 +1,4 @@ +import * as Updates from "expo-updates"; import React, { useState } from "react"; import { Button, @@ -8,14 +9,13 @@ import { TextInput, View, } from "react-native"; -import * as Updates from 'expo-updates'; export default function App() { const [buffer, setBuffer] = useState(""); const [items, setItems] = useState([]); const [status, setStatus] = useState(""); - const [updates, setUpdates] = useState("") + const [updates, setUpdates] = useState(""); const handleChange = (text: string) => { // Scanner "types" characters then appends Enter (\n) @@ -28,37 +28,36 @@ export default function App() { } }; -async function checkServerUpdate() { - setUpdates('Checking for updates...'); - try { + async function checkServerUpdate() { + setUpdates("Checking for updates..."); + try { + const cacheBuster = `?t=${Date.now()}`; - const cacheBuster = `?t=${Date.now()}`; + const res = await Updates.checkForUpdateAsync(); + console.log("Update check result:", res); - const res = await Updates.checkForUpdateAsync(); - console.log('Update check result:', res); - - if (res.isAvailable) { - setUpdates('Update available! Downloading...'); - const fetchResult = await Updates.fetchUpdateAsync(); - console.log('Fetch result:', fetchResult); - - if (fetchResult.isNew) { - setUpdates('Update downloaded! Reloading app...'); - // Add a small delay to ensure everything is ready - setTimeout(() => { - Updates.reloadAsync(); - }, 1000); - } else { - setUpdates('Update download completed but no new bundle?'); - } - } else { - setUpdates('No new update available.'); - } - } catch (e: any) { - console.error('Update error:', e); - setUpdates(`Update failed: ${e.message}`); - } -} + if (res.isAvailable) { + setUpdates("Update available! Downloading..."); + const fetchResult = await Updates.fetchUpdateAsync(); + console.log("Fetch result:", fetchResult); + + if (fetchResult.isNew) { + setUpdates("Update downloaded! Reloading app..."); + // Add a small delay to ensure everything is ready + setTimeout(() => { + Updates.reloadAsync(); + }, 1000); + } else { + setUpdates("Update download completed but no new bundle?"); + } + } else { + setUpdates("No new update available."); + } + } catch (e: any) { + console.error("Update error:", e); + setUpdates(`Update failed: ${e.message}`); + } + } const handleScan = (code: string) => { //console.log("Scanned:", code); @@ -87,9 +86,8 @@ async function checkServerUpdate() { return ( - - But maybe later i will be - + But maybe later i will be +