commercelayer-react-components icon indicating copy to clipboard operation
commercelayer-react-components copied to clipboard

Shipment component loading forever when autoSelectSingleShippingMethod is used

Open AsafeToschi opened this issue 4 months ago • 0 comments

Describe the bug

If you try to use the <Shipment /> component with the autoSelectSingleShippingMethod property it won't finish loading

The cause seems to be the the loader state that never is set to false when we enter this if statement below:

image File: commercelayer-react-components/packages/react-components/src/components/shipments/Shipment.tsx It looks like everything else is working as you refresh the page the component will load.

To Reproduce

  1. Let only one shipping method available on Commerce Layer.
  2. Open a incognito window that implements the <Shipment /> component with the autoSelectSingleShippingMethod property set to true
  3. Wait a few seconds to verify if the ShippingMethod options will load.

Note: For every test close every incognito windows opened and open a new one to always get this first load that never ends.

AsafeToschi avatar Feb 26 '24 01:02 AsafeToschi