web-manager 3.2.71 → 3.2.73

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +10 -3
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1198,15 +1198,22 @@ function subscriptionManager(self, options_user) {
1198
1198
  firebase.messaging().onMessage(function (payload) {
1199
1199
  // Get the notification data
1200
1200
  var notification = payload.notification;
1201
+ var data = payload.data;
1202
+
1203
+ // Get the click action
1204
+ var clickAction = notification.click_action || data.click_action;
1201
1205
 
1202
1206
  // Log
1203
- console.log('Message received', payload);
1207
+ console.log('Message received', payload, clickAction);
1204
1208
 
1205
1209
  // Display notification
1206
1210
  new Notification(notification.title, notification)
1207
1211
  .onclick = function(event) {
1212
+ // Log
1213
+ console.log('Notification clicked', clickAction);
1214
+
1208
1215
  // Quit if there is no click action
1209
- if (!notification.click_action) {
1216
+ if (!clickAction) {
1210
1217
  return;
1211
1218
  }
1212
1219
 
@@ -1214,7 +1221,7 @@ function subscriptionManager(self, options_user) {
1214
1221
  event.preventDefault();
1215
1222
 
1216
1223
  // Open the click action
1217
- window.open(notification.click_action, '_blank');
1224
+ window.open(clickAction, '_blank');
1218
1225
  }
1219
1226
  })
1220
1227
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.71",
3
+ "version": "3.2.73",
4
4
  "description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -40,7 +40,7 @@
40
40
  "replace": {}
41
41
  },
42
42
  "dependencies": {
43
- "@sentry/browser": "^8.34.0",
43
+ "@sentry/browser": "^8.54.0",
44
44
  "cookieconsent": "^3.1.1",
45
45
  "firebase": "^9.23.0",
46
46
  "itwcw-package-analytics": "^1.0.6",