From 3ad7920c2fba73eedc2fe169e57a33b9d81a23dd Mon Sep 17 00:00:00 2001 From: fairlighteth <31534717+fairlighteth@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:57:10 +0000 Subject: [PATCH] feat: table control logic unfillable --- .../ordersTable/containers/OrdersTableWidget/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/cowswap-frontend/src/modules/ordersTable/containers/OrdersTableWidget/index.tsx b/apps/cowswap-frontend/src/modules/ordersTable/containers/OrdersTableWidget/index.tsx index ebebc9972c..3de5f82530 100644 --- a/apps/cowswap-frontend/src/modules/ordersTable/containers/OrdersTableWidget/index.tsx +++ b/apps/cowswap-frontend/src/modules/ordersTable/containers/OrdersTableWidget/index.tsx @@ -160,9 +160,12 @@ export function OrdersTableWidget({ const { currentTabId, currentPageNumber } = useMemo(() => { const params = parseOrdersTableUrl(location.search) - // If we're on the signing tab but there are no signing orders, + // If we're on a tab that becomes empty (signing or unfillable), // default to the all orders tab - if (params.tabId === 'signing' && !ordersList.signing.length) { + if ( + (params.tabId === 'signing' && !ordersList.signing.length) || + (params.tabId === 'unfillable' && !ordersList.unfillable.length) + ) { return { currentTabId: ALL_ORDERS_TAB.id, currentPageNumber: params.pageNumber || 1, @@ -173,7 +176,7 @@ export function OrdersTableWidget({ currentTabId: params.tabId || ALL_ORDERS_TAB.id, currentPageNumber: params.pageNumber || 1, } - }, [location.search, ordersList.signing.length]) + }, [location.search, ordersList.signing.length, ordersList.unfillable.length]) const orders = useMemo(() => { return getOrdersListByIndex(ordersList, currentTabId)