chore: fix updates

This commit is contained in:
2026-03-01 17:12:01 +01:00
parent ce74c16f5d
commit 2fad63c28d
3 changed files with 87 additions and 59 deletions
+19 -1
View File
@@ -1,8 +1,9 @@
import React from "react"; import React, { useEffect } from "react";
import { StatusBar } from "expo-status-bar"; import { StatusBar } from "expo-status-bar";
import { ActivityIndicator, View } from "react-native"; import { ActivityIndicator, View } from "react-native";
import { NavigationContainer } from "@react-navigation/native"; import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack"; import { createNativeStackNavigator } from "@react-navigation/native-stack";
import * as Updates from "expo-updates";
import { AuthProvider, useAuth } from "./src/auth/AuthContext"; import { AuthProvider, useAuth } from "./src/auth/AuthContext";
import { CartProvider } from "./src/context/CartContext"; import { CartProvider } from "./src/context/CartContext";
@@ -99,6 +100,23 @@ function RootNavigator() {
function AppContent() { function AppContent() {
const { isDark } = useTheme(); const { isDark } = useTheme();
useEffect(() => {
if (__DEV__) return;
const checkForUpdate = async () => {
try {
const update = await Updates.checkForUpdateAsync();
if (update.isAvailable) {
await Updates.fetchUpdateAsync();
await Updates.reloadAsync();
}
} catch {
// Silently ignore update errors
}
};
checkForUpdate();
}, []);
return ( return (
<NavigationContainer> <NavigationContainer>
<RootNavigator /> <RootNavigator />
+62 -54
View File
@@ -1,57 +1,65 @@
{ {
"expo": { "expo": {
"name": "Uber Stup", "name": "Uber Stup",
"slug": "frontend-client", "slug": "frontend-client",
"version": "1.0.0", "version": "1.0.0",
"orientation": "portrait", "orientation": "portrait",
"icon": "./assets/icon.png", "icon": "./assets/icon.png",
"userInterfaceStyle": "dark", "userInterfaceStyle": "dark",
"newArchEnabled": true, "newArchEnabled": true,
"splash": { "splash": {
"image": "./assets/icon.png", "image": "./assets/icon.png",
"resizeMode": "contain", "resizeMode": "contain",
"backgroundColor": "#000000" "backgroundColor": "#000000"
}, },
"ios": { "ios": {
"supportsTablet": true, "supportsTablet": true,
"bundleIdentifier": "com.uberstup.clientpanel" "bundleIdentifier": "com.uberstup.clientpanel"
}, },
"android": { "android": {
"adaptiveIcon": { "adaptiveIcon": {
"foregroundImage": "./assets/icon.png", "foregroundImage": "./assets/icon.png",
"backgroundColor": "#000000" "backgroundColor": "#000000"
}, },
"edgeToEdgeEnabled": true, "edgeToEdgeEnabled": true,
"predictiveBackGestureEnabled": false, "predictiveBackGestureEnabled": false,
"package": "com.uberstup.clientpanel", "package": "com.uberstup.clientpanel",
"versionCode": 1, "versionCode": 1,
"permissions": [ "permissions": [
"android.permission.RECEIVE_BOOT_COMPLETED", "android.permission.RECEIVE_BOOT_COMPLETED",
"android.permission.VIBRATE" "android.permission.VIBRATE",
] "android.permission.RECEIVE_BOOT_COMPLETED",
}, "android.permission.VIBRATE"
"web": { ]
"favicon": "./assets/icon.png" },
}, "web": {
"plugins": [ "favicon": "./assets/icon.png"
"expo-font", },
"expo-router", "plugins": [
[ "expo-font",
"expo-notifications", "expo-router",
{ [
"icon": "./assets/icon.png", "expo-notifications",
"color": "#000000", {
"defaultChannel": "orders", "icon": "./assets/icon.png",
"sounds": [] "color": "#000000",
} "defaultChannel": "orders",
] "sounds": []
], }
"extra": { ]
"eas": { ],
"projectId": "110d06c8-a8d5-4b3c-b262-0d4d7509ae9d" "extra": {
}, "eas": {
"router": {} "projectId": "110d06c8-a8d5-4b3c-b262-0d4d7509ae9d"
}, },
"owner": "xor290" "router": {}
},
"owner": "xor290",
"runtimeVersion": {
"policy": "appVersion"
},
"updates": {
"url": "https://u.expo.dev/110d06c8-a8d5-4b3c-b262-0d4d7509ae9d"
} }
}
} }
+6 -4
View File
@@ -16,7 +16,8 @@
}, },
"env": { "env": {
"API_URL": "https://uber-stup.club" "API_URL": "https://uber-stup.club"
} },
"channel": "development"
}, },
"preview": { "preview": {
"distribution": "internal", "distribution": "internal",
@@ -25,18 +26,19 @@
}, },
"env": { "env": {
"API_URL": "https://uber-stup.club" "API_URL": "https://uber-stup.club"
} },
"channel": "preview"
}, },
"production": { "production": {
"distribution": "internal", "distribution": "internal",
"autoIncrement": true, "autoIncrement": true,
"channel": "production",
"android": { "android": {
"buildType": "apk" "buildType": "apk"
}, },
"env": { "env": {
"API_URL": "https://uber-stup.club" "API_URL": "https://uber-stup.club"
} },
"channel": "production"
} }
} }
} }