diff --git a/app/profil/page.tsx b/app/profil/page.tsx index f554ead..8e4acae 100644 --- a/app/profil/page.tsx +++ b/app/profil/page.tsx @@ -135,10 +135,16 @@ export default function ProfilePage() { const registration = await navigator.serviceWorker.ready; const sub = await registration.pushManager.getSubscription(); if (sub) { - const { data } = await supabase.from('push_subscriptions').select('topics').eq('endpoint', sub.endpoint).single(); - if (data?.topics) setSelectedTopics(data.topics); + const { data, error } = await supabase.from('push_subscriptions').select('topics').eq('endpoint', sub.endpoint).single(); + if (error) { + console.error('Błąd pobierania tematów powiadomień:', error); + } else if (data?.topics) { + setSelectedTopics(data.topics); + } } - } catch (e) { console.error(e); } + } catch (e) { + console.error('Błąd podczas sprawdzania statusu subskrypcji:', e); + } } else { setPushState('NOT_SUBSCRIBED'); } diff --git a/package-lock.json b/package-lock.json index 433dffd..368619f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -77,7 +77,7 @@ "shadcn": "^3.8.4", "tailwindcss": "^4", "tw-animate-css": "^1.4.0", - "typescript": "5.7.3" + "typescript": "^5.7.3" } }, "node_modules/@ai-sdk/gateway": { diff --git a/package.json b/package.json index 2ae4b5a..4dcb0d3 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,6 @@ "shadcn": "^3.8.4", "tailwindcss": "^4", "tw-animate-css": "^1.4.0", - "typescript": "5.7.3" + "typescript": "^5.7.3" } }