diff --git a/mobile/app.json b/mobile/app.json index e374ce0..1e84ebf 100644 --- a/mobile/app.json +++ b/mobile/app.json @@ -31,7 +31,8 @@ { "iCloudContainerEnvironment": "Production" } ], "expo-background-fetch", - "expo-task-manager" + "expo-task-manager", + "@maplibre/maplibre-react-native" ] } } diff --git a/mobile/app/activity/[id].tsx b/mobile/app/activity/[id].tsx index 3d73e70..dd22815 100644 --- a/mobile/app/activity/[id].tsx +++ b/mobile/app/activity/[id].tsx @@ -34,6 +34,9 @@ export default function ActivityScreen() { const [loadingMap, setLoadingMap] = useState(false); const [loadingChart, setLoadingChart] = useState(false); + // instanceUrl and token are in the dep array to avoid a stale-closure bug in + // release builds: Hermes executes effects sooner and captures empty strings if + // the deps are omitted. Guards on geojson/timeseries prevent double-fetching. useEffect(() => { if (!row) return; @@ -62,7 +65,8 @@ export default function ActivityScreen() { .catch(() => {}) .finally(() => setLoadingChart(false)); } - }, [row?.id]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [row?.id, instanceUrl, token]); if (!row) { return (