@pelcro/react-pelcro-js 3.22.0-beta.13 → 3.22.0-beta.15

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/index.cjs.js CHANGED
@@ -17461,16 +17461,18 @@ const PaymentMethodContainerWithoutStripe = _ref => {
17461
17461
  items: mappedOrderItems,
17462
17462
  addressId: selectedAddressId,
17463
17463
  couponCode
17464
- }, (err, res) => {
17465
- dispatch({
17466
- type: DISABLE_SUBMIT,
17467
- payload: false
17468
- });
17469
- dispatch({
17470
- type: LOADING,
17471
- payload: false
17472
- });
17464
+ }, (err, orderResponse) => {
17465
+ var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro2$user$;
17473
17466
  if (err) {
17467
+ toggleAuthenticationSuccessPendingView(false);
17468
+ dispatch({
17469
+ type: DISABLE_SUBMIT,
17470
+ payload: false
17471
+ });
17472
+ dispatch({
17473
+ type: LOADING,
17474
+ payload: false
17475
+ });
17474
17476
  onFailure(err);
17475
17477
  return dispatch({
17476
17478
  type: SHOW_ALERT,
@@ -17490,7 +17492,30 @@ const PaymentMethodContainerWithoutStripe = _ref => {
17490
17492
  cartItems: []
17491
17493
  });
17492
17494
  }
17493
- onSuccess(res);
17495
+ window.Pelcro.user.refresh({
17496
+ auth_token: (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : (_window$Pelcro2$user$ = _window$Pelcro2$user.read()) === null || _window$Pelcro2$user$ === void 0 ? void 0 : _window$Pelcro2$user$.auth_token
17497
+ }, (err, res) => {
17498
+ dispatch({
17499
+ type: DISABLE_SUBMIT,
17500
+ payload: false
17501
+ });
17502
+ dispatch({
17503
+ type: LOADING,
17504
+ payload: false
17505
+ });
17506
+ toggleAuthenticationSuccessPendingView(false);
17507
+ if (err) {
17508
+ onFailure(err);
17509
+ return dispatch({
17510
+ type: SHOW_ALERT,
17511
+ payload: {
17512
+ type: "error",
17513
+ content: getErrorMessages(err)
17514
+ }
17515
+ });
17516
+ }
17517
+ onSuccess(orderResponse);
17518
+ });
17494
17519
  });
17495
17520
  };
17496
17521
  const payInvoice = (gatewayService, gatewayToken, dispatch) => {
@@ -21527,6 +21552,7 @@ const AddressCreateContainer = _ref => {
21527
21552
  first_name: firstName,
21528
21553
  last_name: lastName,
21529
21554
  line1: line1,
21555
+ line2: line2,
21530
21556
  city: city,
21531
21557
  state: state,
21532
21558
  country: country,
@@ -22354,6 +22380,7 @@ const AddressUpdateContainer = _ref => {
22354
22380
  first_name: firstName,
22355
22381
  last_name: lastName,
22356
22382
  line1: line1,
22383
+ line2: line2,
22357
22384
  city: city,
22358
22385
  state: state,
22359
22386
  country: country,
@@ -27635,7 +27662,7 @@ const InvoicesItems = () => {
27635
27662
  setInvoice,
27636
27663
  switchView
27637
27664
  } = usePelcro();
27638
- const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
27665
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.order_id || invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
27639
27666
  const showInvoiceDetails = event => {
27640
27667
  if (setInvoice(event.target.dataset.id)) {
27641
27668
  switchView("invoice-details");
@@ -28403,7 +28430,7 @@ class Dashboard extends React.Component {
28403
28430
  }
28404
28431
  function hasInvoices() {
28405
28432
  var _window$Pelcro$invoic, _window$Pelcro$invoic2;
28406
- const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
28433
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.order_id || invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
28407
28434
  return invoices.length > 0;
28408
28435
  }
28409
28436
  function hasDonationSubs() {
package/dist/index.esm.js CHANGED
@@ -17431,16 +17431,18 @@ const PaymentMethodContainerWithoutStripe = _ref => {
17431
17431
  items: mappedOrderItems,
17432
17432
  addressId: selectedAddressId,
17433
17433
  couponCode
17434
- }, (err, res) => {
17435
- dispatch({
17436
- type: DISABLE_SUBMIT,
17437
- payload: false
17438
- });
17439
- dispatch({
17440
- type: LOADING,
17441
- payload: false
17442
- });
17434
+ }, (err, orderResponse) => {
17435
+ var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro2$user$;
17443
17436
  if (err) {
17437
+ toggleAuthenticationSuccessPendingView(false);
17438
+ dispatch({
17439
+ type: DISABLE_SUBMIT,
17440
+ payload: false
17441
+ });
17442
+ dispatch({
17443
+ type: LOADING,
17444
+ payload: false
17445
+ });
17444
17446
  onFailure(err);
17445
17447
  return dispatch({
17446
17448
  type: SHOW_ALERT,
@@ -17460,7 +17462,30 @@ const PaymentMethodContainerWithoutStripe = _ref => {
17460
17462
  cartItems: []
17461
17463
  });
17462
17464
  }
17463
- onSuccess(res);
17465
+ window.Pelcro.user.refresh({
17466
+ auth_token: (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : (_window$Pelcro2$user$ = _window$Pelcro2$user.read()) === null || _window$Pelcro2$user$ === void 0 ? void 0 : _window$Pelcro2$user$.auth_token
17467
+ }, (err, res) => {
17468
+ dispatch({
17469
+ type: DISABLE_SUBMIT,
17470
+ payload: false
17471
+ });
17472
+ dispatch({
17473
+ type: LOADING,
17474
+ payload: false
17475
+ });
17476
+ toggleAuthenticationSuccessPendingView(false);
17477
+ if (err) {
17478
+ onFailure(err);
17479
+ return dispatch({
17480
+ type: SHOW_ALERT,
17481
+ payload: {
17482
+ type: "error",
17483
+ content: getErrorMessages(err)
17484
+ }
17485
+ });
17486
+ }
17487
+ onSuccess(orderResponse);
17488
+ });
17464
17489
  });
17465
17490
  };
17466
17491
  const payInvoice = (gatewayService, gatewayToken, dispatch) => {
@@ -21497,6 +21522,7 @@ const AddressCreateContainer = _ref => {
21497
21522
  first_name: firstName,
21498
21523
  last_name: lastName,
21499
21524
  line1: line1,
21525
+ line2: line2,
21500
21526
  city: city,
21501
21527
  state: state,
21502
21528
  country: country,
@@ -22324,6 +22350,7 @@ const AddressUpdateContainer = _ref => {
22324
22350
  first_name: firstName,
22325
22351
  last_name: lastName,
22326
22352
  line1: line1,
22353
+ line2: line2,
22327
22354
  city: city,
22328
22355
  state: state,
22329
22356
  country: country,
@@ -27605,7 +27632,7 @@ const InvoicesItems = () => {
27605
27632
  setInvoice,
27606
27633
  switchView
27607
27634
  } = usePelcro();
27608
- const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
27635
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.order_id || invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
27609
27636
  const showInvoiceDetails = event => {
27610
27637
  if (setInvoice(event.target.dataset.id)) {
27611
27638
  switchView("invoice-details");
@@ -28373,7 +28400,7 @@ class Dashboard extends Component {
28373
28400
  }
28374
28401
  function hasInvoices() {
28375
28402
  var _window$Pelcro$invoic, _window$Pelcro$invoic2;
28376
- const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
28403
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.order_id || invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
28377
28404
  return invoices.length > 0;
28378
28405
  }
28379
28406
  function hasDonationSubs() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.22.0-beta.13",
4
+ "version": "3.22.0-beta.15",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",