From e999b79fdb65a4bec533e334ddb04ae1b9078099 Mon Sep 17 00:00:00 2001 From: Siddarth Kumar Date: Sun, 19 Jul 2026 12:28:26 +0530 Subject: [PATCH] settings: add version to settings --- mobile-app/app.config.js | 14 ++++++++++++++ mobile-app/eslint.config.js | 1 + mobile-app/package.json | 1 + mobile-app/src/screens/SettingsScreen.tsx | 4 +++- mobile-app/yarn.lock | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 mobile-app/app.config.js diff --git a/mobile-app/app.config.js b/mobile-app/app.config.js new file mode 100644 index 0000000..9065cbe --- /dev/null +++ b/mobile-app/app.config.js @@ -0,0 +1,14 @@ +const fs = require('fs'); +const path = require('path'); + +module.exports = ({ config }) => { + let version = config.version; + try { + version = fs + .readFileSync(path.join(__dirname, '..', 'VERSION'), 'utf8') + .trim(); + } catch { + // keep app.json's version as a fallback + } + return { ...config, version }; +}; diff --git a/mobile-app/eslint.config.js b/mobile-app/eslint.config.js index 5c4578e..6de8b29 100644 --- a/mobile-app/eslint.config.js +++ b/mobile-app/eslint.config.js @@ -57,6 +57,7 @@ module.exports = [ '.expo/**', 'dist/**', 'web-build/**', + 'app.config.js', 'babel.config.js', 'metro.config.js', 'eslint.config.js', diff --git a/mobile-app/package.json b/mobile-app/package.json index 8c4b729..3e67ff2 100644 --- a/mobile-app/package.json +++ b/mobile-app/package.json @@ -26,6 +26,7 @@ "@shopify/flash-list": "^2.3.1", "expo": "~54.0.10", "expo-camera": "~17.0.10", + "expo-constants": "~18.0.9", "expo-dev-client": "~6.0.12", "expo-file-system": "~19.0.21", "expo-haptics": "~15.0.8", diff --git a/mobile-app/src/screens/SettingsScreen.tsx b/mobile-app/src/screens/SettingsScreen.tsx index aacb683..399109a 100644 --- a/mobile-app/src/screens/SettingsScreen.tsx +++ b/mobile-app/src/screens/SettingsScreen.tsx @@ -17,6 +17,7 @@ import { TextInput, View, } from 'react-native'; +import Constants from 'expo-constants'; import { Focusable } from '../components/Focusable'; import { SafeAreaView } from 'react-native-safe-area-context'; import GoBridge from '../GoServerBridgeJSI'; @@ -424,6 +425,7 @@ export function SettingsScreen() { App + @@ -590,7 +592,7 @@ export function SettingsScreen() { Continuous background sync - Off by default. When on, SyncUp keeps syncing while backgrounded instead of only in the brief windows iOS normally allows, closer to how it behaves on Android. Uses noticeably more battery, since the sync engine and network stay awake continuously. + Off by default. When on, SyncUp keeps syncing while backgrounded instead of only in the brief windows iOS normally allows. Uses noticeably more battery.