Skip to content

Commit

Permalink
refactor(com-pwa): use object.values
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed Jun 8, 2023
1 parent f4050a3 commit 258a602
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions uniquely/com-pwa/src/ui/stuff/user-inc-order-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ export class alwatrUserIncOrderBox extends LocalizeMixin(SignalMixin(AlwatrBaseE

protected _renderOrderBox(): unknown {
let orderListTemplate;
if (Object.keys(this.userIncOrder!.orderList).length === 0) {
const orderListValues = Object.values(this.userIncOrder?.orderList ?? []);
if (orderListValues.length === 0) {
orderListTemplate = html`<span class="empty-order"
>${message('page_admin_order_list_empty_order_list')}<span></span
></span>`;
}
else {
const orderList = Object.values(this.userIncOrder!.orderList).sort((o1, o2) => {
const orderList = orderListValues.sort((o1, o2) => {
return (o2.meta?.updated || 0) - (o1.meta?.updated || 0);
});

Expand Down

0 comments on commit 258a602

Please sign in to comment.