Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix server state query returning undefined (#10232)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

authored by

Samuel Newman
Claude Opus 4.6 (1M context)
and committed by
GitHub
5d0b9007 9b31bb84

+10 -6
+10 -6
src/ageAssurance/data.tsx
··· 183 183 const geolocation = device.get(['mergedGeolocation']) 184 184 if (!geolocation || !geolocation.countryCode) { 185 185 logger.error(`getServerState: missing geolocation countryCode`) 186 - return 186 + return null 187 187 } 188 188 const {data} = await agent.app.bsky.ageassurance.getState({ 189 189 countryCode: geolocation.countryCode, ··· 225 225 try { 226 226 logger.debug(`prefetchServerState: resolving...`) 227 227 const res = await networkRetry(3, () => getServerState({agent})) 228 - qc.setQueryData<AppBskyAgeassuranceGetState.OutputSchema>(qk, res) 228 + if (res) { 229 + qc.setQueryData<AppBskyAgeassuranceGetState.OutputSchema>(qk, res) 230 + } 229 231 } catch (err) { 230 232 const e = err as Error 231 233 logger.warn(`prefetchServerState: failed`, { ··· 238 240 if (!did) return 239 241 logger.debug(`refetchServerState: fetching...`) 240 242 const res = await networkRetry(3, () => getServerState({agent})) 241 - qc.setQueryData<AppBskyAgeassuranceGetState.OutputSchema>( 242 - createServerStateQueryKey({did}), 243 - res, 244 - ) 243 + if (res) { 244 + qc.setQueryData<AppBskyAgeassuranceGetState.OutputSchema>( 245 + createServerStateQueryKey({did}), 246 + res, 247 + ) 248 + } 245 249 return res 246 250 } 247 251 export function usePatchServerState() {