web-manager 3.1.1 → 3.1.4

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.
Files changed (2) hide show
  1. package/lib/account.js +14 -3
  2. package/package.json +2 -2
package/lib/account.js CHANGED
@@ -256,7 +256,9 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
256
256
  });
257
257
  }
258
258
  } catch (e) {
259
- console.error('Unable to check query strings', e);
259
+ if (typeof window !== 'undefined') {
260
+ console.error('Unable to check query strings', e);
261
+ }
260
262
  }
261
263
 
262
264
  var planExpireDate = new Date(account.plan.expires.timestamp);
@@ -355,7 +357,14 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
355
357
  referralURL.pathname = '/';
356
358
  referralURL.searchParams.set('aff', account.affiliate.code)
357
359
 
358
- authCreatedEl.setInnerHTML(new Date(parseInt(currentUser.metadata.a)).toLocaleString(undefined, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }))
360
+ authCreatedEl.setInnerHTML(
361
+ new Date(
362
+ parseInt(utilities.get(currentUser, 'metadata.a', '0'))
363
+ )
364
+ .toLocaleString(undefined, {
365
+ weekday: 'long', year: 'numeric', month: 'long', day: 'numeric',
366
+ })
367
+ )
359
368
  authPhoneInput.setInnerHTML(currentUser.phoneNumber).setValue(currentUser.phoneNumber)
360
369
 
361
370
  billingSubscribeBtn.setAttribute('hidden', true);
@@ -416,7 +425,9 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
416
425
  })
417
426
 
418
427
  } catch (e) {
419
- // console.error('Unable to set DOM elements', e);
428
+ if (typeof window !== 'undefined') {
429
+ console.error('Unable to set DOM elements', e);
430
+ }
420
431
  }
421
432
 
422
433
  self.properties = account;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.1.1",
3
+ "version": "3.1.4",
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
+ }