From bd969b34d76bea5ed81b6497d611efccae6984c7 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sat, 20 Dec 2025 12:29:54 +0000 Subject: feat: add server version display to mobile app settings (#2276) - Created useServerVersion hook to fetch server version from /api/version - Display both app version (from expo-constants) and server version - Added version info at the bottom of settings page - Server version shows loading state and handles errors gracefully Co-authored-by: Claude --- apps/mobile/app/dashboard/(tabs)/settings.tsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'apps/mobile/app/dashboard/(tabs)') diff --git a/apps/mobile/app/dashboard/(tabs)/settings.tsx b/apps/mobile/app/dashboard/(tabs)/settings.tsx index 7c1e00d6..db19b6fe 100644 --- a/apps/mobile/app/dashboard/(tabs)/settings.tsx +++ b/apps/mobile/app/dashboard/(tabs)/settings.tsx @@ -2,6 +2,7 @@ import { useEffect } from "react"; import { ActivityIndicator, Pressable, Switch, View } from "react-native"; import { Slider } from "react-native-awesome-slider"; import { useSharedValue } from "react-native-reanimated"; +import Constants from "expo-constants"; import { Link } from "expo-router"; import { Button } from "@/components/ui/Button"; import ChevronRight from "@/components/ui/ChevronRight"; @@ -9,6 +10,7 @@ import CustomSafeAreaView from "@/components/ui/CustomSafeAreaView"; import { Divider } from "@/components/ui/Divider"; import PageTitle from "@/components/ui/PageTitle"; import { Text } from "@/components/ui/Text"; +import { useServerVersion } from "@/lib/hooks"; import { useSession } from "@/lib/session"; import useAppSettings from "@/lib/settings"; import { api } from "@/lib/trpc"; @@ -30,6 +32,11 @@ export default function Dashboard() { }, [settings]); const { data, error, isLoading } = api.users.whoami.useQuery(); + const { + data: serverVersion, + isLoading: isServerVersionLoading, + error: serverVersionError, + } = useServerVersion(); if (error?.data?.code === "UNAUTHORIZED") { logout(); @@ -141,6 +148,19 @@ export default function Dashboard() { > Log Out + + + App Version: {Constants.expoConfig?.version ?? "unknown"} + + + Server Version:{" "} + {isServerVersionLoading + ? "Loading..." + : serverVersionError + ? "unavailable" + : (serverVersion ?? "unknown")} + + ); -- cgit v1.2.3-70-g09d2