diff --git a/web/src/lib/components/MobileAppDownload.svelte b/web/src/lib/components/MobileAppDownload.svelte index cedaddff..6766e96d 100644 --- a/web/src/lib/components/MobileAppDownload.svelte +++ b/web/src/lib/components/MobileAppDownload.svelte @@ -11,6 +11,10 @@ // bandwidth abuse on the APK stream, so this component only shows // for logged-in users. Mount in Settings, never in pre-auth surfaces. + // Server returns snake_case (clientVersionResponse in + // internal/api/client_assets.go). Map to a camelCase struct for + // the rest of the component. + type WireInfo = { version: string; apk_url: string; size_bytes: number }; type Info = { version: string; apkUrl: string; sizeBytes: number }; let info = $state(null); @@ -22,12 +26,12 @@ onMount(async () => { try { - const body = await api.get>('/api/client/version'); - if (!body.version || !body.apkUrl) return; + const body = await api.get>('/api/client/version'); + if (!body.version || !body.apk_url) return; info = { version: body.version, - apkUrl: body.apkUrl, - sizeBytes: body.sizeBytes ?? 0 + apkUrl: body.apk_url, + sizeBytes: body.size_bytes ?? 0 }; } catch { // 404 (no APK), 401 (somehow unauthed), network error — silent.