Skip to content

Commit

Permalink
fix(payment-option): hide dibs when no previous orders (#697)
Browse files Browse the repository at this point in the history
Currently, handout orders do _not_ produce a movedFromOrder, and thus
the originalOrderIds array will be empty. Since we just check that every
order is by the customer, this will return true if there are no orders.
Therefore, we have to reject DIBS if there are no previous orders.
  • Loading branch information
AdrianAndersen authored Aug 29, 2023
1 parent 041535f commit ca21429
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export class PaymentMethodSelectComponent implements OnInit {
)
);

return originalOrders.every((order) => order.byCustomer);
return (
originalOrders.length > 0 &&
originalOrders.every((order) => order.byCustomer)
);
}

public onInputChange() {
Expand Down

0 comments on commit ca21429

Please sign in to comment.