From 3113b3ec692eaaf0ac2a3fd43ee919075fc41445 Mon Sep 17 00:00:00 2001 From: Glen Chiacchieri Date: Wed, 4 Aug 2021 12:37:39 -0400 Subject: [PATCH] 2.4.1 add trialStartedAt to uninitialized user object, fix installedAt --- ExtPay.dev.js | 3 ++- dist/ExtPay.common.js | 3 ++- dist/ExtPay.js | 3 ++- dist/ExtPay.module.js | 3 ++- package.json | 2 +- sample-extension/ExtPay.js | 3 ++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ExtPay.dev.js b/ExtPay.dev.js index d3ee760..3436fa8 100644 --- a/ExtPay.dev.js +++ b/ExtPay.dev.js @@ -122,7 +122,8 @@ You can copy and paste this to your manifest.json file to fix this error: return { paid: false, paidAt: null, - installedAt: new Date(storage.extensionpay_installed_at), + installedAt: storage.extensionpay_installed_at ? new Date(storage.extensionpay_installed_at) : new Date(), // sometimes this function gets called before the initial install time can be flushed to storage + trialStartedAt: null, } } diff --git a/dist/ExtPay.common.js b/dist/ExtPay.common.js index a7884b4..0375698 100644 --- a/dist/ExtPay.common.js +++ b/dist/ExtPay.common.js @@ -122,7 +122,8 @@ You can copy and paste this to your manifest.json file to fix this error: return { paid: false, paidAt: null, - installedAt: new Date(storage.extensionpay_installed_at), + installedAt: storage.extensionpay_installed_at ? new Date(storage.extensionpay_installed_at) : new Date(), // sometimes this function gets called before the initial install time can be flushed to storage + trialStartedAt: null, } } diff --git a/dist/ExtPay.js b/dist/ExtPay.js index 26a0f9c..24ec469 100644 --- a/dist/ExtPay.js +++ b/dist/ExtPay.js @@ -1351,7 +1351,8 @@ You can copy and paste this to your manifest.json file to fix this error: return { paid: false, paidAt: null, - installedAt: new Date(storage.extensionpay_installed_at), + installedAt: storage.extensionpay_installed_at ? new Date(storage.extensionpay_installed_at) : new Date(), // sometimes this function gets called before the initial install time can be flushed to storage + trialStartedAt: null, } } diff --git a/dist/ExtPay.module.js b/dist/ExtPay.module.js index e35aee2..2f6bf0c 100644 --- a/dist/ExtPay.module.js +++ b/dist/ExtPay.module.js @@ -120,7 +120,8 @@ You can copy and paste this to your manifest.json file to fix this error: return { paid: false, paidAt: null, - installedAt: new Date(storage.extensionpay_installed_at), + installedAt: storage.extensionpay_installed_at ? new Date(storage.extensionpay_installed_at) : new Date(), // sometimes this function gets called before the initial install time can be flushed to storage + trialStartedAt: null, } } diff --git a/package.json b/package.json index c0dcac7..f96a6cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "extpay", - "version": "2.4.0", + "version": "2.4.1", "description": "The JavaScript library for https://extensionpay.com - payments for browser extensions, no server needed.", "main": "./dist/ExtPay.common.js", "module": "./dist/ExtPay.module.js", diff --git a/sample-extension/ExtPay.js b/sample-extension/ExtPay.js index 26a0f9c..24ec469 100644 --- a/sample-extension/ExtPay.js +++ b/sample-extension/ExtPay.js @@ -1351,7 +1351,8 @@ You can copy and paste this to your manifest.json file to fix this error: return { paid: false, paidAt: null, - installedAt: new Date(storage.extensionpay_installed_at), + installedAt: storage.extensionpay_installed_at ? new Date(storage.extensionpay_installed_at) : new Date(), // sometimes this function gets called before the initial install time can be flushed to storage + trialStartedAt: null, } }