Skip to content

Commit

Permalink
updated sw file and min file
Browse files Browse the repository at this point in the history
  • Loading branch information
KambleSonam committed Jan 11, 2024
1 parent b2d8975 commit 6d267a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
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.

0 comments on commit 6d267a3

Please sign in to comment.