commercelayer/commercelayer-react-components

`<OrderList>` component does not render content when one of `orders` or `subscriptions` list is empty

gciotola opened this issue · 0 comments

Describe the bug

OrderList component is used to render a list of orders or order_subscriptions as a sortable table by fetching data using a customer token.

When OrderList is used to display a list of orders and the customer doesn't have any subscriptions, the component breaks the page rendering.

Also related to #430

To Reproduce

  1. With version 4.7.1
  2. Use an access token for a customer that has only orders and no subscriptions (or vice versa)
  3. Mount <OrderList> as our basic example
  4. The "is empty" condition is reached (it should not) and the page breaks since context contains orders to display

System

No response

Additional context

No response