diff options
| author | Adam Soltys <[email protected]> | 2020-09-29 19:10:56 -0400 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-10-01 03:18:48 -0400 |
| commit | ab68967fe875719eee6b94e5bc9b3e2131a10bda (patch) | |
| tree | 6375bf77c1cb0afee4e15de1a2d3065032c3c4bf /lib | |
| parent | f0f4532a8f8d5dbdec4d27f635494b925752f43e (diff) | |
| download | coinos-server-ab68967fe875719eee6b94e5bc9b3e2131a10bda.tar.gz coinos-server-ab68967fe875719eee6b94e5bc9b3e2131a10bda.zip | |
remove bad subscription
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/notifications.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/notifications.js b/lib/notifications.js index b1c4b05f..18d5b503 100644 --- a/lib/notifications.js +++ b/lib/notifications.js @@ -16,7 +16,7 @@ notify = (user, payload) => { try { await webpush.sendNotification(subscription, payload); } catch (e) { - if (e.body && e.body.includes('expired')) { + if (e.body && (e.body.includes('expired') || e.body.includes('No such'))) { user.subscriptions.splice(i, 1); await user.save(); } else { |
