more promises
This commit is contained in:
parent
11054bdad7
commit
03ef01672e
5 changed files with 11 additions and 11 deletions
|
|
@ -40,10 +40,10 @@ function subscribePush(registration, isEnabled, vapidPublicKey) {
|
|||
return registration.pushManager.subscribe(subscribeOptions)
|
||||
}
|
||||
|
||||
function unsubscribePush(registration) {
|
||||
async function unsubscribePush(registration) {
|
||||
return registration.pushManager.getSubscription().then((subscription) => {
|
||||
if (subscription === null) {
|
||||
return Promise.resolve('No subscription')
|
||||
return 'No subscription'
|
||||
}
|
||||
return subscription.unsubscribe()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue