gitflow-hotfix-stash: update_subscription

This commit is contained in:
ostertun
2020-10-09 12:59:20 +02:00
parent cf5f71d14e
commit de70522850
2 changed files with 14 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
<?php <?php
define('PWA_VERSION', '1.10.3h1'); define('PWA_VERSION', '1.10.3h2');
?> ?>

View File

@@ -311,3 +311,16 @@ self.addEventListener('notificationclick', function(event) {
clients.openWindow(url) clients.openWindow(url)
); );
}); });
self.addEventListener('pushsubscriptionchange', function(event) {
var formData = new URLSearchParams();
formData.append('old', JSON.stringify(event.oldSubscription));
formData.append('new', JSON.stringify(event.newSubscription));
event.waitUntil(
fetch('<?php echo QUERY_URL; ?>update_subscription', {
method: 'POST',
cache: 'no-cache',
body: formData
})
);
});