Browse Source

Update 2016-12-16T18:27:05.559Z

gh-pages
Igor Zhukov 8 years ago
parent
commit
03441a67db
  1. 7
      js/lib/push_worker.js
  2. 2
      service_worker.js
  3. 2
      webogram.appcache

7
js/lib/push_worker.js

@ -30,7 +30,8 @@ self.addEventListener('push', function(event) {
if (closeAll) { if (closeAll) {
console.log('[SW] Closing all notifications on push') console.log('[SW] Closing all notifications on push')
var promise = self.registration.showNotification('Telegram').then(function () { var promise = self.registration.showNotification('Telegram').then(function () {
return closeAllNotifications(obj) // return closeAllNotifications()
setTimeout(closeAllNotifications, 0)
}).catch(function (error) { }).catch(function (error) {
console.error('Show notification error', error) console.error('Show notification error', error)
}) })
@ -66,7 +67,7 @@ self.addEventListener('message', function(event) {
} }
} }
if (event.data.type == 'notifications_clear') { if (event.data.type == 'notifications_clear') {
closeAllNotifications(event.data) closeAllNotifications()
} }
if (event.data.baseUrl) { if (event.data.baseUrl) {
baseUrl = event.data.baseUrl baseUrl = event.data.baseUrl
@ -161,7 +162,7 @@ function removeFromNotifications(notification) {
} }
} }
function closeAllNotifications(obj) { function closeAllNotifications() {
for (var i = 0, len = notifications.length; i < len; i++) { for (var i = 0, len = notifications.length; i < len; i++) {
try { try {
notifications[i].close() notifications[i].close()

2
service_worker.js

File diff suppressed because one or more lines are too long

2
webogram.appcache

@ -1,5 +1,5 @@
CACHE MANIFEST CACHE MANIFEST
# Time: Fri Dec 16 2016 20:01:04 GMT+0300 (MSK) # Time: Fri Dec 16 2016 21:26:09 GMT+0300 (MSK)
CACHE: CACHE:

Loading…
Cancel
Save