web-manager 3.2.43 → 3.2.44

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -556,7 +556,7 @@ function Manager() {
556
556
  self.properties.global.app = configuration.global.app;
557
557
  self.properties.global.version = configuration.global.version;
558
558
  self.properties.global.url = configuration.global.url;
559
- self.properties.global.buildTime = new Date(+configuration.global.buildTime * 1000);
559
+ self.properties.global.buildTime = new Date((+configuration.global.buildTime * 1000) || new Date())
560
560
  self.properties.global.cacheBreaker = configuration.global.cacheBreaker;
561
561
 
562
562
  self.properties.global.brand = configuration.global.brand;
@@ -1204,7 +1204,7 @@ function Manager() {
1204
1204
  }
1205
1205
  })
1206
1206
  .then(function (data) {
1207
- var buildTimeCurrent = self.properties.global.buildTime;
1207
+ var buildTimeCurrent = self.properties.global.buildTime || new Date(0);
1208
1208
  var buildTimeLive = new Date(data['npm-build'].timestamp);
1209
1209
 
1210
1210
  // Log
@@ -1214,6 +1214,10 @@ function Manager() {
1214
1214
  if (buildTimeCurrent < buildTimeLive) {
1215
1215
  console.log('refreshNewVersion(): Refreshing...');
1216
1216
 
1217
+ if (self.isDevelopment()) {
1218
+ return;
1219
+ }
1220
+
1217
1221
  // Force page reload
1218
1222
  window.onbeforeunload = function () {
1219
1223
  return undefined;
package/lib/account.js CHANGED
@@ -266,15 +266,21 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
266
266
  account.plan.trial.expires.timestampUNIX = Math.round(new Date(account.plan.trial.expires.timestamp || 0).getTime() / 1000);
267
267
 
268
268
  // @@@DEVELOPER
269
+ // var date = '2024-04-23T00:07:29.183Z';
270
+ // var date = `2024-03-23T00:07:29.183Z`;
269
271
  // account.plan.id = 'basic';
270
272
  // account.plan.trial = {
271
273
  // activated: false,
272
274
  // expires: {
273
- // timestamp: new Date('2024-04-23T00:07:29.183Z').toISOString(),
274
- // timestampUNIX: Math.round(new Date('2024-04-23T00:07:29.183Z').getTime() / 1000),
275
- // }
275
+ // timestamp: new Date(date).toISOString(),
276
+ // timestampUNIX: Math.round(new Date(date).getTime() / 1000),
277
+ // },
276
278
  // }
277
- // account.plan.status = 'suspended';
279
+ // account.plan.expires = {
280
+ // timestamp: new Date(date).toISOString(),
281
+ // timestampUNIX: Math.round(new Date(date).getTime() / 1000),
282
+ // }
283
+ // account.plan.status = 'cancelled';
278
284
 
279
285
  account.plan.limits = account.plan.limits || {};
280
286
  // account.plan.devices = account.plan.devices || 1;
@@ -329,6 +335,7 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
329
335
  var trialExpireDate = new Date(account.plan.trial.expires.timestamp);
330
336
  var daysTillTrialExpire = Math.floor((trialExpireDate - now) / 86400000);
331
337
  var startDate = new Date(account.plan.payment.startDate.timestamp);
338
+ var unresolvedPlanId = account.plan.id;
332
339
  var planIsActive = difference > -1 && account.plan.id !== defaultPlanId;
333
340
  var planIsSuspended = account.plan.status === 'suspended';
334
341
 
@@ -511,13 +518,15 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
511
518
  // If user is on trial, start date is trial exp date
512
519
  var visibleStartDate = account.plan.trial.activated ? account.plan.trial.expires.timestamp : account.plan.payment.startDate.timestamp;
513
520
  // If basic, just show account creation date
514
- if (isBasicPlan) {
521
+ if (unresolvedPlanId === defaultPlanId) {
515
522
  visibleStartDate = accountCreationDate;
523
+ billingStatusEl.setAttribute('hidden', true);
516
524
  }
517
525
  var visibleFrequency = account.plan.payment.frequency === 'unknown' ? 'monthly' : account.plan.payment.frequency;
518
526
 
519
527
  // Update billing UI
520
- billingPlanId.setInnerHTML(splitDashesAndUppercase(account.plan.id));
528
+ // billingPlanId.setInnerHTML(splitDashesAndUppercase(account.plan.id));
529
+ billingPlanId.setInnerHTML(splitDashesAndUppercase(unresolvedPlanId)); // Show unresolved because we want to show what plan they have bought not what the expirattion status resolves to
521
530
  billingFrequencyEl.setInnerHTML(visibleFrequency);
522
531
  billingStatusEl.setInnerHTML(visibleStatus);
523
532
  billingStatusColorEl
@@ -531,9 +540,11 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
531
540
  billingStartDateEl.setInnerHTML(new Date(visibleStartDate).toLocaleString(undefined, {
532
541
  year: 'numeric', month: 'long', day: 'numeric',
533
542
  }));
534
- billingExpirationDateEl.setInnerHTML(isBasicPlan && daysTillExpire < 366
535
- ? '<i class="fas fa-exclamation-triangle mr-1"></i> Expires in ' + daysTillExpire + ' days '
536
- : '');
543
+ // billingExpirationDateEl.setInnerHTML(isBasicPlan && daysTillExpire < 366
544
+ billingExpirationDateEl.setInnerHTML('<i class="fas fa-exclamation-triangle mr-1"></i> Expires in ' + daysTillExpire + ' days ');
545
+ if (daysTillExpire > 0 && daysTillExpire < 366) {
546
+ billingExpirationDateEl.removeAttribute('hidden');
547
+ }
537
548
 
538
549
  // Update payment method UI
539
550
  if (account.plan.status === 'suspended') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.43",
3
+ "version": "3.2.44",
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": {