@lancom/shared 0.0.213 → 0.0.216

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/store/index.js +7 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.213",
3
+ "version": "0.0.216",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
package/store/index.js CHANGED
@@ -55,19 +55,20 @@ export const actions = {
55
55
  commit('setCountry', settings.country);
56
56
  commit('setCurrency', settings.currency);
57
57
 
58
- debugger;
59
58
  if (process.env.PINPAYMENT_PUBLISHABLE_API_KEY) {
60
59
  commit('setPayment', {
61
60
  type: 'pinpayment',
62
61
  clientKey: process.env.PINPAYMENT_PUBLISHABLE_API_KEY
63
62
  });
64
63
  } else {
65
- const countrySettings = shop.countries.find(c => c.country?._id === settings.country?._id) || { settings: [] };
64
+ const countrySettings = (shop.countries || []).find(c => c.country?._id === settings.country?._id) || { settings: [] };
66
65
  const countrySetting = countrySettings.settings.find(s => !!s.settings.app.STRIPE_PUBLIC_KEY);
67
- commit('setPayment', {
68
- type: 'stripe',
69
- clientKey: countrySetting.settings.app.STRIPE_PUBLIC_KEY
70
- });
66
+ if (countrySetting) {
67
+ commit('setPayment', {
68
+ type: 'stripe',
69
+ clientKey: countrySetting.settings.app.STRIPE_PUBLIC_KEY
70
+ });
71
+ }
71
72
  }
72
73
 
73
74
  // }