Skip to content

Commit

Permalink
tweak debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ybizeul committed Oct 9, 2024
1 parent 72a74e2 commit c1c2ff3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web/ui/src/YBFeed/Components/YBNotificationToggleComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,21 @@ 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) => {
setLoading(false)
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})
})
Expand All @@ -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)
Expand Down

0 comments on commit c1c2ff3

Please sign in to comment.