aboutsummaryrefslogtreecommitdiffstats
path: root/lib/notifications.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-09-29 19:10:56 -0400
committerAdam Soltys <[email protected]>2020-10-01 03:18:48 -0400
commitab68967fe875719eee6b94e5bc9b3e2131a10bda (patch)
tree6375bf77c1cb0afee4e15de1a2d3065032c3c4bf /lib/notifications.js
parentf0f4532a8f8d5dbdec4d27f635494b925752f43e (diff)
downloadcoinos-server-ab68967fe875719eee6b94e5bc9b3e2131a10bda.tar.gz
coinos-server-ab68967fe875719eee6b94e5bc9b3e2131a10bda.zip
remove bad subscription
Diffstat (limited to 'lib/notifications.js')
-rw-r--r--lib/notifications.js2
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 {