()
| 32 | } |
| 33 | |
| 34 | const checkSubscription = async () => { |
| 35 | try { |
| 36 | const registration = await navigator.serviceWorker.ready; |
| 37 | const subscription = await registration.pushManager.getSubscription(); |
| 38 | setSubscribed(Boolean(subscription)); |
| 39 | } catch (error) { |
| 40 | console.error("Error checking push subscription:", error); |
| 41 | setSubscribed(false); |
| 42 | } finally { |
| 43 | setLoading(false); |
| 44 | } |
| 45 | }; |
| 46 | |
| 47 | checkSubscription(); |
| 48 | }, []); |
no outgoing calls
no test coverage detected