From c1c2ff331e234be546492110c3fa2be05a6fa15a Mon Sep 17 00:00:00 2001 From: Yann Bizeul Date: Wed, 9 Oct 2024 13:23:07 +0200 Subject: [PATCH] tweak debug --- .../Components/YBNotificationToggleComponent.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/ui/src/YBFeed/Components/YBNotificationToggleComponent.tsx b/web/ui/src/YBFeed/Components/YBNotificationToggleComponent.tsx index a4bf773..47ab1e6 100644 --- a/web/ui/src/YBFeed/Components/YBNotificationToggleComponent.tsx +++ b/web/ui/src/YBFeed/Components/YBNotificationToggleComponent.tsx @@ -103,7 +103,7 @@ export function YBNotificationToggleComponent(props:NotificationToggleProps) { .then((subscription) => { console.log("got subscription", subscription) if (subscription === null) { - //setLoading(true) + setLoading(true) console.log("subscribing") Subscribe(vapid) .then((subscription) => { @@ -111,13 +111,13 @@ export function YBNotificationToggleComponent(props:NotificationToggleProps) { const s = subscription as PushSubscription console.log("got subscription", subscription) if (s.endpoint) { - //setNotificationsOn(true) + setNotificationsOn(true) return } - throw new Error("Unable to subscribe") + throw new Error("empty endpoint") }) .catch(e => { - //setLoading(false) + setLoading(false) console.log(e) notifications.show({message:"Unable to subscribe", color:"red", ...defaultNotificationProps}) }) @@ -144,7 +144,7 @@ export function YBNotificationToggleComponent(props:NotificationToggleProps) { setNotificationsOn(true) return } - throw new Error("Unable to subscribe") + throw new Error("empty endpoint") }) .catch(e => { setLoading(false)