From 6a34d1140fb1c868ff43e3608fb06b9bfe5aef9b Mon Sep 17 00:00:00 2001 From: Boki Date: Wed, 18 Jun 2025 08:58:41 -0400 Subject: [PATCH] a bit more work on exchanges --- .../exchanges/components/ExchangesTable.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/apps/web-app/src/features/exchanges/components/ExchangesTable.tsx b/apps/web-app/src/features/exchanges/components/ExchangesTable.tsx index 416cac9..2b8668e 100644 --- a/apps/web-app/src/features/exchanges/components/ExchangesTable.tsx +++ b/apps/web-app/src/features/exchanges/components/ExchangesTable.tsx @@ -62,6 +62,20 @@ export function ExchangesTable() { async (mappingId: string, currentStatus: boolean) => { const success = await updateProviderMapping(mappingId, { active: !currentStatus }); if (success) { + // Update the local expanded row data immediately + setExpandedRowData(prev => { + const updated = { ...prev }; + Object.keys(updated).forEach(exchangeId => { + updated[exchangeId] = updated[exchangeId].map(mapping => + mapping.id === mappingId + ? { ...mapping, active: !currentStatus } + : mapping + ); + }); + return updated; + }); + + // Also refresh the main table data refetch(); } }, @@ -298,13 +312,13 @@ export function ExchangesTable() { { id: 'actions', header: 'Actions', - size: 140, + size: 160, disableTooltip: true, cell: ({ row }) => (