@ordergroove/offers 2.45.1 → 2.45.2-alpha-PR-1184-2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle-report.html +1 -1
- package/dist/offers.js +1 -1
- package/dist/offers.js.map +2 -2
- package/package.json +2 -2
- package/src/components/Offer.js +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordergroove/offers",
|
|
3
|
-
"version": "2.45.
|
|
3
|
+
"version": "2.45.2-alpha-PR-1184-2.9+c628ef05",
|
|
4
4
|
"description": "offer state component",
|
|
5
5
|
"author": "Eugenio Lattanzio <eugenio63@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ordergroove/plush-toys#readme",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"@ordergroove/offers-templates": "^0.9.7",
|
|
50
50
|
"@types/lodash.memoize": "^4.1.9"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "c628ef05192e41c3e3ce5d7ce7d29bd8c4c4c86d"
|
|
53
53
|
}
|
package/src/components/Offer.js
CHANGED
|
@@ -81,11 +81,17 @@ export class Offer extends TemplateElement {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
firstUpdated() {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
try {
|
|
85
|
+
const preview = Array.from(this.getAttributeNames()).find(it => it.startsWith('preview-'));
|
|
86
|
+
if (preview === 'preview-standard-offer') this.preview = 'regular';
|
|
87
|
+
else if (preview === 'preview-upsell-offer') this.preview = 'upsell';
|
|
88
|
+
else if (preview === 'preview-subscribed-offer') this.preview = 'subscribed';
|
|
89
|
+
else if (preview === 'preview-prepaid-offer') this.preview = 'prepaid';
|
|
90
|
+
} catch (e) {
|
|
91
|
+
// in some rare cases, getAttributeNames throws an error and prevents the offer from initializing
|
|
92
|
+
// since preview mode is non-essential, we can log and ignore it
|
|
93
|
+
console.warn('Unable to set preview property', e);
|
|
94
|
+
}
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
static get styles() {
|