From fbac1e079eac01853ebb61ea63869571653e53bd Mon Sep 17 00:00:00 2001 From: padreug Date: Fri, 5 Sep 2025 05:16:31 +0200 Subject: [PATCH] Refactor OrderHistory to improve order status handling - Update OrderHistory.vue to utilize a new method, getEffectiveStatus, for determining the effective order status based on payment and shipping conditions. - Modify the display logic for pending orders to check if the order is paid before showing the waiting for invoice message, enhancing clarity for users. - Ensure consistent status formatting by applying the new method across relevant components. --- src/modules/market/components/OrderHistory.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/modules/market/components/OrderHistory.vue b/src/modules/market/components/OrderHistory.vue index 9bb93c8..943d0c6 100644 --- a/src/modules/market/components/OrderHistory.vue +++ b/src/modules/market/components/OrderHistory.vue @@ -81,8 +81,8 @@
- - {{ formatStatus(order.status) }} + + {{ formatStatus(getEffectiveStatus(order)) }}

@@ -190,7 +190,7 @@

-
+
Waiting for Payment Invoice @@ -314,6 +314,15 @@ const isOrderPaid = (order: Order) => { return order.paymentStatus === 'paid' } +const getEffectiveStatus = (order: Order) => { + // If paid, return 'paid' regardless of original status + if (isOrderPaid(order)) { + return order.shipped ? 'shipped' : 'paid' + } + // Otherwise return the original status + return order.status +} + const formatDate = (timestamp: number) => { return new Date(timestamp * 1000).toLocaleDateString('en-US', { year: 'numeric',