web-manager 2.1.37 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1082,7 +1082,8 @@ function Manager() {
1082
1082
  dateSubscribed: {
1083
1083
  timestamp: timestamp,
1084
1084
  timestampUNIX: timestampUNIX
1085
- }
1085
+ },
1086
+ url: window.location.href,
1086
1087
  },
1087
1088
  token: token,
1088
1089
  link: {
@@ -1164,6 +1165,7 @@ function Manager() {
1164
1165
  navigator.serviceWorker.register('/' + (options_user.serviceWorker.path || 'master-service-worker.js') + '?config=' + encodeURIComponent(JSON.stringify({name: This.properties.global.brand.name, env: This.properties.meta.environment, v: This.properties.global.version, firebase: options_user.libraries.firebase_app.config})) )
1165
1166
  .then(function (registration) {
1166
1167
  // firebase.messaging().useServiceWorker(registration);
1168
+ // console.log('----TEST registration', registration);
1167
1169
  This.properties.references.serviceWorker = registration;
1168
1170
  // console.log('====registration', registration);
1169
1171
  // console.log('navigator.serviceWorker.controller', navigator.serviceWorker.controller);
@@ -1221,8 +1223,14 @@ function Manager() {
1221
1223
  try {
1222
1224
  // Normally, notifications are not displayed when user is ON PAGE but we will display it here anyway
1223
1225
  firebase.messaging().onMessage(function (payload) {
1224
- new Notification(payload.notification.title, payload.notification);
1226
+ // console.log('---payload', payload);
1227
+ new Notification(payload.notification.title, payload.notification)
1228
+ .onclick = function(event) {
1229
+ event.preventDefault(); // prevent the browser from focusing the Notification's tab
1230
+ window.open(payload.notification.click_action, '_blank');
1231
+ }
1225
1232
  })
1233
+ // console.log('---SKIPPING ONMESSAGE');
1226
1234
  } catch (e) {
1227
1235
  console.error(e);
1228
1236
  }
package/lib/account.js CHANGED
@@ -214,7 +214,8 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
214
214
  account.plan.expires = account.plan.expires || {};
215
215
  account.plan.expires.timestamp = new Date(account.plan.expires.timestamp || 0).toISOString();
216
216
  account.plan.expires.timestampUNIX = Math.round(new Date(account.plan.expires.timestamp || 0).getTime() / 1000);
217
- account.plan.devices = account.plan.devices || 1;
217
+ account.plan.limits = account.plan.limits || {};
218
+ // account.plan.devices = account.plan.devices || 1;
218
219
 
219
220
  account.plan.payment = account.plan.payment || {};
220
221
  account.plan.payment.startDate = account.plan.payment.startDate || {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "2.1.37",
3
+ "version": "3.0.2",
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": {
@@ -28,4 +28,4 @@
28
28
  "firebase": "^8.10.1",
29
29
  "lazysizes": "^5.3.2"
30
30
  }
31
- }
31
+ }