Skip to content

Shipment component loading forever when autoSelectSingleShippingMethod is used #491

@AsafeToschi

Description

@AsafeToschi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions