Skip to content

Commit 41375ec

Browse files
pablomendezroyoPablo Mendez
andauthored
Fix deleting old subscription (#2211)
Co-authored-by: Pablo Mendez <pablo@dappnode.io>
1 parent 2dc4c0b commit 41375ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/admin-ui/src/hooks/PWA/useHandleSubscription.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function useHandleSubscription(): UseHandleSubscriptionResult {
136136
// Clean up any old subscription
137137
if (subscription && !isSubInNotifier) {
138138
console.log("Deleting old subscription");
139-
deleteSubscription(subscription.endpoint);
139+
await deleteSubscription(subscription.endpoint);
140140
}
141141

142142
// Convert + validate VAPID key
@@ -174,7 +174,7 @@ export function useHandleSubscription(): UseHandleSubscriptionResult {
174174
} finally {
175175
setIsSubscribing(false);
176176
}
177-
}, [vapidKey, device, browser, os, isSubInNotifier]);
177+
}, [vapidKey, device, browser, os, isSubInNotifier, subscription]);
178178

179179
function urlBase64ToUint8Array(base64String: string) {
180180
const padding = "=".repeat((4 - (base64String.length % 4)) % 4);

0 commit comments

Comments
 (0)