aboutsummaryrefslogtreecommitdiff
path: root/static/sw.js
blob: e77867703e6de45429e74f79e11b94593c0c4b9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'use strict';

self.addEventListener('notificationclick', function(e) {
  var notification = e.notification;
  var primaryKey = notification.data.primaryKey;
  var action = e.action;

  if (action === 'close') {
    notification.close();
  } else {
    clients.openWindow(permalink);
    notification.close();
  }
});