web-manager 3.2.44 → 3.2.46
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +4 -1
- package/lib/account.js +51 -3
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1204,9 +1204,12 @@ 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;
|
1208
1208
|
var buildTimeLive = new Date(data['npm-build'].timestamp);
|
1209
1209
|
|
1210
|
+
// Set buildTimeCurrent to 1 hour ahead to account for the npm-build time which will ALWAYS be set to later since it happens later
|
1211
|
+
buildTimeCurrent.setHours(buildTimeCurrent.getHours() + 1);
|
1212
|
+
|
1210
1213
|
// Log
|
1211
1214
|
console.log('refreshNewVersion()', data, buildTimeCurrent, buildTimeLive);
|
1212
1215
|
|
package/lib/account.js
CHANGED
@@ -267,8 +267,9 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
|
|
267
267
|
|
268
268
|
// @@@DEVELOPER
|
269
269
|
// var date = '2024-04-23T00:07:29.183Z';
|
270
|
-
// var date = `2024-03-23T00:07:29.183Z`;
|
271
|
-
// account.plan.id = 'basic';
|
270
|
+
// // var date = `2024-03-23T00:07:29.183Z`;
|
271
|
+
// // account.plan.id = 'basic';
|
272
|
+
// account.plan.id = 'premium';
|
272
273
|
// account.plan.trial = {
|
273
274
|
// activated: false,
|
274
275
|
// expires: {
|
@@ -281,6 +282,43 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
|
|
281
282
|
// timestampUNIX: Math.round(new Date(date).getTime() / 1000),
|
282
283
|
// }
|
283
284
|
// account.plan.status = 'cancelled';
|
285
|
+
// account.plan = {
|
286
|
+
// "id": "premium",
|
287
|
+
// "payment": {
|
288
|
+
// "frequency": "monthly",
|
289
|
+
// "startDate": {
|
290
|
+
// "timestampUNIX": 1711373195,
|
291
|
+
// "timestamp": "2024-03-25T13:26:35.000Z"
|
292
|
+
// },
|
293
|
+
// "updatedBy": {
|
294
|
+
// "date": {
|
295
|
+
// "timestamp": "2024-04-02T13:46:47.441Z",
|
296
|
+
// "timestampUNIX": 1712065607
|
297
|
+
// },
|
298
|
+
// "event": {
|
299
|
+
// "name": "subscription-profile-fixer",
|
300
|
+
// "id": "subscription-profile-fixer"
|
301
|
+
// }
|
302
|
+
// },
|
303
|
+
// "resourceId": "AzyrfuU82V0cZ87qp",
|
304
|
+
// "orderId": "0908-176942-1223",
|
305
|
+
// "active": false,
|
306
|
+
// "processor": "chargebee"
|
307
|
+
// },
|
308
|
+
// "trial": {
|
309
|
+
// "expires": {
|
310
|
+
// "timestamp": "1970-01-01T00:00:00.000Z",
|
311
|
+
// "timestampUNIX": 0
|
312
|
+
// },
|
313
|
+
// "activated": true
|
314
|
+
// },
|
315
|
+
// "expires": {
|
316
|
+
// "timestampUNIX": 1714656799,
|
317
|
+
// "timestamp": "2024-05-02T13:33:19.000Z"
|
318
|
+
// },
|
319
|
+
// "limits": {},
|
320
|
+
// "status": "cancelled"
|
321
|
+
// },
|
284
322
|
|
285
323
|
account.plan.limits = account.plan.limits || {};
|
286
324
|
// account.plan.devices = account.plan.devices || 1;
|
@@ -516,11 +554,21 @@ Account.prototype._resolveAccount = function (firebaseUser, account, options) {
|
|
516
554
|
// Change the status to 'failed' if the plan is suspended because room temperature IQ people think 'suspended' means 'cancelled'
|
517
555
|
var visibleStatus = uppercase(account.plan.status === 'suspended' ? 'failed payment' : account.plan.status);
|
518
556
|
// If user is on trial, start date is trial exp date
|
519
|
-
var visibleStartDate =
|
557
|
+
var visibleStartDate = null;
|
520
558
|
// If basic, just show account creation date
|
521
559
|
if (unresolvedPlanId === defaultPlanId) {
|
522
560
|
visibleStartDate = accountCreationDate;
|
523
561
|
billingStatusEl.setAttribute('hidden', true);
|
562
|
+
} else {
|
563
|
+
if (account.plan.status === 'cancelled') {
|
564
|
+
visibleStartDate = account.plan.payment.startDate.timestamp;
|
565
|
+
} else {
|
566
|
+
if (account.plan.trial.activated) {
|
567
|
+
visibleStartDate = account.plan.trial.expires.timestamp;
|
568
|
+
}
|
569
|
+
}
|
570
|
+
|
571
|
+
visibleStartDate = visibleStartDate || accountCreationDate;
|
524
572
|
}
|
525
573
|
var visibleFrequency = account.plan.payment.frequency === 'unknown' ? 'monthly' : account.plan.payment.frequency;
|
526
574
|
|
package/package.json
CHANGED