@blocklet/payment-react 1.15.16 → 1.15.17

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.
@@ -43,7 +43,7 @@ const sortOrder = {
43
43
  const groupItemsByRecurring = (items, currency) => {
44
44
  const grouped = {};
45
45
  const recurring = {};
46
- items.forEach((x) => {
46
+ (items || []).forEach((x) => {
47
47
  const key = [x.price.recurring?.interval, x.price.recurring?.interval_count].join("-");
48
48
  if (x.price.currency_options?.find((c) => c.currency_id === currency.id)) {
49
49
  recurring[key] = x.price.recurring;
@@ -116,7 +116,7 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
116
116
  if (!state.interval) {
117
117
  return [];
118
118
  }
119
- grouped[state.interval].forEach((x) => {
119
+ (grouped[state.interval] || []).forEach((x) => {
120
120
  getPriceCurrencyOptions(x.price).forEach((c) => {
121
121
  visited[c?.currency_id] = true;
122
122
  });
@@ -30,7 +30,7 @@ const sortOrder = {
30
30
  const groupItemsByRecurring = (items, currency) => {
31
31
  const grouped = {};
32
32
  const recurring = {};
33
- items.forEach(x => {
33
+ (items || []).forEach(x => {
34
34
  const key = [x.price.recurring?.interval, x.price.recurring?.interval_count].join("-");
35
35
  if (x.price.currency_options?.find(c => c.currency_id === currency.id)) {
36
36
  recurring[key] = x.price.recurring;
@@ -126,7 +126,7 @@ function PricingTable({
126
126
  if (!state.interval) {
127
127
  return [];
128
128
  }
129
- grouped[state.interval].forEach(x => {
129
+ (grouped[state.interval] || []).forEach(x => {
130
130
  (0, _util2.getPriceCurrencyOptions)(x.price).forEach(c => {
131
131
  visited[c?.currency_id] = true;
132
132
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-react",
3
- "version": "1.15.16",
3
+ "version": "1.15.17",
4
4
  "description": "Reusable react components for payment kit v2",
5
5
  "keywords": [
6
6
  "react",
@@ -53,10 +53,10 @@
53
53
  }
54
54
  },
55
55
  "dependencies": {
56
- "@arcblock/did-connect": "^2.10.39",
57
- "@arcblock/ux": "^2.10.39",
56
+ "@arcblock/did-connect": "^2.10.45",
57
+ "@arcblock/ux": "^2.10.45",
58
58
  "@arcblock/ws": "^1.18.135",
59
- "@blocklet/ui-react": "^2.10.39",
59
+ "@blocklet/ui-react": "^2.10.45",
60
60
  "@mui/icons-material": "^5.16.6",
61
61
  "@mui/lab": "^5.0.0-alpha.173",
62
62
  "@mui/material": "^5.16.6",
@@ -92,7 +92,7 @@
92
92
  "@babel/core": "^7.25.2",
93
93
  "@babel/preset-env": "^7.25.2",
94
94
  "@babel/preset-react": "^7.24.7",
95
- "@blocklet/payment-types": "1.15.16",
95
+ "@blocklet/payment-types": "1.15.17",
96
96
  "@storybook/addon-essentials": "^7.6.20",
97
97
  "@storybook/addon-interactions": "^7.6.20",
98
98
  "@storybook/addon-links": "^7.6.20",
@@ -122,5 +122,5 @@
122
122
  "vite-plugin-babel": "^1.2.0",
123
123
  "vite-plugin-node-polyfills": "^0.21.0"
124
124
  },
125
- "gitHead": "6514eec9e9d7c69735a76ac097644248b3634b3f"
125
+ "gitHead": "746e67a4e0542f308289edd4e2d6bdd64e49e53e"
126
126
  }
@@ -50,7 +50,7 @@ const groupItemsByRecurring = (items: TPricingTableItem[], currency: { id: strin
50
50
  const grouped: { [key: string]: TPricingTableItem[] } = {};
51
51
  const recurring: { [key: string]: PriceRecurring } = {};
52
52
 
53
- items.forEach((x) => {
53
+ (items || []).forEach((x) => {
54
54
  const key = [x.price.recurring?.interval, x.price.recurring?.interval_count].join('-');
55
55
  if (x.price.currency_options?.find((c: PriceCurrency) => c.currency_id === currency.id)) {
56
56
  recurring[key] = x.price.recurring as PriceRecurring;
@@ -141,7 +141,7 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
141
141
  if (!state.interval) {
142
142
  return [];
143
143
  }
144
- grouped[state.interval].forEach((x: TPricingTableItem) => {
144
+ (grouped[state.interval] || []).forEach((x: TPricingTableItem) => {
145
145
  getPriceCurrencyOptions(x.price).forEach((c: PriceCurrency) => {
146
146
  visited[c?.currency_id] = true;
147
147
  });