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, } }