web-manager 3.2.40 → 3.2.42

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/lib/account.js +14 -9
  2. package/package.json +3 -3
package/lib/account.js CHANGED
@@ -237,8 +237,8 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
237
237
  var timestampUNIXOld = 0;
238
238
 
239
239
  // TODO: ADD THESE THINGS: USAGE RESOVLER ETC
240
- console.log('++++++account', JSON.stringify(account, null, 2));
241
- console.log('++++++options', JSON.stringify(options, null, 2));
240
+ console.log('++++++account 1', JSON.stringify(account, null, 2));
241
+ console.log('++++++options 1', JSON.stringify(options, null, 2));
242
242
 
243
243
  // @@@DEVELOPER
244
244
  // account.plan = {};
@@ -450,6 +450,7 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
450
450
 
451
451
  var updateURL = new URL(cancelURL);
452
452
  var referralURL = new URL(window.location.origin || window.location.host);
453
+ var accountCreationDate = new Date(+self.utilities.get(firebaseUser, 'metadata.createdAt', '0'));
453
454
 
454
455
  function _setAuthItem(selector, value) {
455
456
  self.dom.select(selector).each(function(e, i) {
@@ -465,9 +466,9 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
465
466
  referralURL.searchParams.set('aff', account.affiliate.code)
466
467
 
467
468
  authCreatedEl.setInnerHTML(
468
- new Date(+self.utilities.get(firebaseUser, 'metadata.createdAt', '0'))
469
+ new Date(accountCreationDate)
469
470
  .toLocaleString(undefined, {
470
- weekday: 'long', year: 'numeric', month: 'long', day: 'numeric',
471
+ year: 'numeric', month: 'long', day: 'numeric',
471
472
  })
472
473
  )
473
474
  authPhoneInput.setInnerHTML(firebaseUser.phoneNumber).setValue(firebaseUser.phoneNumber)
@@ -477,8 +478,8 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
477
478
 
478
479
  billingUpdateBtn.setAttribute('hidden', true).setAttribute('href', updateURL.toString());
479
480
  billingSubscribeBtn.setAttribute('hidden', true);
480
- billingSuspendedMessageEl.setAttribute('hidden');
481
- billingTrialExpirationDateEl.setAttribute('hidden');
481
+ billingSuspendedMessageEl.setAttribute('hidden', true);
482
+ billingTrialExpirationDateEl.setAttribute('hidden', true);
482
483
 
483
484
  // Update active UI
484
485
  if (planIsActive) {
@@ -509,9 +510,9 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
509
510
  var visibleStatus = uppercase(account.plan.status === 'suspended' ? 'failed payment' : account.plan.status);
510
511
  // If user is on trial, start date is trial exp date
511
512
  var visibleStartDate = account.plan.trial.activated ? account.plan.trial.expires.timestamp : account.plan.payment.startDate.timestamp;
513
+ // If basic, just show account creation date
512
514
  if (isBasicPlan) {
513
- // Set as start of this month
514
- visibleStartDate = new Date(now.getFullYear(), now.getMonth(), 1).toISOString();
515
+ visibleStartDate = accountCreationDate;
515
516
  }
516
517
  var visibleFrequency = account.plan.payment.frequency === 'unknown' ? 'monthly' : account.plan.payment.frequency;
517
518
 
@@ -528,7 +529,7 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
528
529
  billingStatusColorEl.addClass('bg-soft-danger').addClass('text-danger');
529
530
  }
530
531
  billingStartDateEl.setInnerHTML(new Date(visibleStartDate).toLocaleString(undefined, {
531
- weekday: 'long', year: 'numeric', month: 'long', day: 'numeric',
532
+ year: 'numeric', month: 'long', day: 'numeric',
532
533
  }));
533
534
  billingExpirationDateEl.setInnerHTML(isBasicPlan && daysTillExpire < 366
534
535
  ? '<i class="fas fa-exclamation-triangle mr-1"></i> Expires in ' + daysTillExpire + ' days '
@@ -575,6 +576,10 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
575
576
  }
576
577
  })
577
578
 
579
+ // TODO: ADD THESE THINGS: USAGE RESOVLER ETC
580
+ console.log('++++++account 2', JSON.stringify(account, null, 2));
581
+ console.log('++++++options 2', JSON.stringify(options, null, 2));
582
+
578
583
  } catch (e) {
579
584
  if (typeof window !== 'undefined') {
580
585
  console.error('Unable to set DOM elements', e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.40",
3
+ "version": "3.2.42",
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": {
@@ -31,9 +31,9 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@sentry/browser": "^7.98.0",
34
+ "@sentry/browser": "^7.108.0",
35
35
  "cookieconsent": "^3.1.1",
36
36
  "firebase": "^9.23.0",
37
37
  "lazysizes": "^5.3.2"
38
38
  }
39
- }
39
+ }