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 10, 2023
1 parent f4050a3 commit f68e334
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 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,15 @@ export class alwatrUserIncOrderBox extends LocalizeMixin(SignalMixin(AlwatrBaseE

protected _renderOrderBox(): unknown {
let orderListTemplate;
if (Object.keys(this.userIncOrder!.orderList).length === 0) {
orderListTemplate = html`<span class="empty-order"
>${message('page_admin_order_list_empty_order_list')}<span></span
></span>`;
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>`;
}
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 f68e334

Please sign in to comment.