diff --git a/app/hooks/usePushNotifications.ts b/app/hooks/usePushNotifications.ts index a572331..38d30cc 100644 --- a/app/hooks/usePushNotifications.ts +++ b/app/hooks/usePushNotifications.ts @@ -68,9 +68,11 @@ export function usePushNotifications() { setPermission(perm); if (perm !== "granted") return false; - // Get the VAPID public key from the backend. + // Get the VAPID public key from the backend. The backend's view returns + // {"public_key": ...} but its global CamelCaseJSONRenderer rewrites that + // to {"publicKey": ...} on the wire — so we read camelCase here. const keyRes = await fetch(`${apiBase}/api/notif/v1/push/vapid-public-key/`); - const { public_key: publicKey } = await keyRes.json(); + const { publicKey } = await keyRes.json(); if (!publicKey) return false; const reg = await navigator.serviceWorker.ready;