MCPcopy Index your code
hub / github.com/coder/coder / checkSubscription

Function checkSubscription

site/src/contexts/useWebpushNotifications.ts:34–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 }, []);

Callers 1

useWebpushNotificationsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected