diff --git a/scripts/build.mjs b/scripts/build.mjs index 0e57964..7f0a54c 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -74,7 +74,7 @@ const config = { constModules: { globals: { "bunny-build-info": { - version: `"1.0.0"`, + version: `"1.0.1"`, }, }, }, diff --git a/src/core/ui/settings/pages/General/About.tsx b/src/core/ui/settings/pages/General/About.tsx index 409abdf..7f82827 100644 --- a/src/core/ui/settings/pages/General/About.tsx +++ b/src/core/ui/settings/pages/General/About.tsx @@ -3,7 +3,7 @@ import { PupuIcon } from "@core/ui/settings"; import Version from "@core/ui/settings/pages/General/Version"; import { useProxy } from "@core/vendetta/storage"; import { getDebugInfo } from "@lib/api/debug"; -import { settings } from "@lib/api/settings"; +import { settings, loaderConfig } from "@lib/api/settings"; import { Stack, TableRowGroup, TableRow, Text } from "@metro/common/components"; import { Platform, ScrollView, View } from "react-native"; import { findAssetId } from "@lib/api/assets"; @@ -11,6 +11,48 @@ import { findAssetId } from "@lib/api/assets"; export default function About() { const debugInfo = getDebugInfo(); useProxy(settings); + useProxy(loaderConfig); + + function getBuildType() { + // If running in React Native dev mode, treat as development + if (__DEV__) return "Development"; + + try { + // If a custom URL is enabled, inspect it + if (loaderConfig?.customLoadUrl?.enabled) { + const url = loaderConfig.customLoadUrl.url ?? ""; + const u = new URL(url); + const host = u.hostname; + + // Localhost / local IP -> dev server (bun run serve) + if ( + host === "localhost" || + host === "127.0.0.1" || + host === "0.0.0.0" || + host.startsWith("192.") || + host.startsWith("10.") || + host.startsWith("172.") + ) + return "Development"; + + // If the URL points to GitHub releases/raw, treat as Release + if ( + url.includes("github.com") || + url.includes("raw.githubusercontent.com") || + url.includes("/releases/") + ) + return "Release"; + + // Custom remote URL (not recognized as local or GitHub) + return "Custom"; + } + } catch (e) { + // If URL parsing fails, fall back below + } + + // Default: when not using a custom URL the loader fetches from GitHub releases + return "Release"; + } const coreVersions = [ { @@ -139,20 +181,9 @@ export default function About() { } icon={} /> - - } - icon={} - /> - } + trailing={} icon={} /> diff --git a/src/modules.d.ts b/src/modules.d.ts index addcef5..25b1e06 100644 --- a/src/modules.d.ts +++ b/src/modules.d.ts @@ -1,8 +1,8 @@ declare module "bunny-build-info" { - const version: "1.0.0"; + const version: "1.0.1"; } declare module "*.png" { - const str: string; - export default str; + const str: string; + export default str; }