diff --git a/apps/expo/features/trail-conditions/hooks/useTrailConditionReports.ts b/apps/expo/features/trail-conditions/hooks/useTrailConditionReports.ts index 8483401035..ca75ab2aa4 100644 --- a/apps/expo/features/trail-conditions/hooks/useTrailConditionReports.ts +++ b/apps/expo/features/trail-conditions/hooks/useTrailConditionReports.ts @@ -18,23 +18,22 @@ function cacheKey(userId: string, trailName?: string): string { /** Persist fetched reports to AsyncStorage for offline / cold-start access. */ async function writeCachedReports( reports: TrailConditionReport[], - userId: string, - trailName?: string, + opts: { userId: string; trailName?: string }, ) { try { - await AsyncStorage.setItem(cacheKey(userId, trailName), JSON.stringify(reports)); + await AsyncStorage.setItem(cacheKey(opts.userId, opts.trailName), JSON.stringify(reports)); } catch { // Best-effort — swallow write errors silently } } /** Read previously-cached reports from AsyncStorage. */ -async function readCachedReports( - userId: string, - trailName?: string, -): Promise { +async function readCachedReports(opts: { + userId: string; + trailName?: string; +}): Promise { try { - const raw = await AsyncStorage.getItem(cacheKey(userId, trailName)); + const raw = await AsyncStorage.getItem(cacheKey(opts.userId, opts.trailName)); if (raw) return JSON.parse(raw) as TrailConditionReport[]; } catch { // Corrupt or missing cache — ignore @@ -78,7 +77,7 @@ export function useTrailConditionReports(trailName?: string) { useEffect(() => { let cancelled = false; setCachedReports(undefined); - readCachedReports(currentUserId, trailName).then((reports) => { + readCachedReports({ userId: currentUserId, trailName }).then((reports) => { if (!cancelled) setCachedReports(reports); }); return () => { @@ -106,7 +105,7 @@ export function useTrailConditionReports(trailName?: string) { useEffect(() => { if (query.data && query.data !== prevDataRef.current && query.isFetched) { prevDataRef.current = query.data; - writeCachedReports(query.data, currentUserId, trailName); + writeCachedReports(query.data, { userId: currentUserId, trailName }); } }, [query.data, query.isFetched, currentUserId, trailName]); diff --git a/biome.json b/biome.json index 46acc41c2c..747429f8c6 100644 --- a/biome.json +++ b/biome.json @@ -37,7 +37,7 @@ "useMaxParams": { "level": "error", "options": { - "max": 3 + "max": 2 } } }, @@ -46,6 +46,28 @@ } } }, + "overrides": [ + { + "includes": [ + "apps/expo/atoms/atomWith*.ts", + "apps/expo/features/weather/atoms/locationsAtoms.ts", + "packages/api/src/routes/admin/index.ts", + "packages/api/src/services/r2-bucket.ts", + "packages/api/src/services/etl/processCatalogEtl.ts", + "packages/api/test/guides.test.ts", + "packages/api/test/setup.ts", + "apps/expo/utils/weight.ts", + "packages/api/src/utils/weight.ts" + ], + "linter": { + "rules": { + "complexity": { + "useMaxParams": "off" + } + } + } + } + ], "css": { "parser": { "cssModules": false,