Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servive worker release #184

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions sw_webpush.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,10 @@ if (typeof globalRedirectPath === 'undefined') {
self.addEventListener('install', function (event) {
// force this service worker to become the active service worker; removes any previous implementations or migrations
self.skipWaiting()
// console.log('Service worker installed', self, event);
console.log('CT Service worker installed')
})

self.addEventListener('activate', function (event) {
// console.log('Service worker activated', self, event);
// Delete all caches that aren't named in CURRENT_CACHES.
// var expectedCacheNames = Object.keys(CURRENT_CACHES).map(function(key) {
// return CURRENT_CACHES[key];
// });
//
// event.waitUntil(
// caches.keys()
// .then(function(cacheNames) {
// return Promise.all(
// cacheNames.map(function(cacheName) {
// if (expectedCacheNames.indexOf(cacheName) === -1) {
// // If this cache name isn't present in the array of "expected" cache names, then delete it.
// console.log('Deleting out of date cache:', cacheName);
// return caches.delete(cacheName);
// }
// })
// );
// })
// .catch(function(){
// console.log("Error while clearing cache")
// })
// );
console.log('CT Service worker activated')
})

Expand Down Expand Up @@ -140,9 +117,6 @@ self.addEventListener('notificationclick', function (event) {
var promise = localforage.getItem(key).then(function (value) {
var notificationData = JSON.parse(value)
var redirectPath = notificationData.redirectPath
// console.log("event",event);
// console.log("redirect path: " + redirectPath);
// console.log("notification data: " + notificationData);
onClick(event, redirectPath, notificationData)
}).catch(function (err) {
// This code runs if there were any errors
Expand Down
2 changes: 1 addition & 1 deletion sw_webpush.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading