diff --git a/.changeset/rich-windows-rule.md b/.changeset/rich-windows-rule.md new file mode 100644 index 000000000000..28f7cc253ae7 --- /dev/null +++ b/.changeset/rich-windows-rule.md @@ -0,0 +1,5 @@ +--- +"ledger-live-desktop": patch +--- + +bugfix: close exchangeComplete for card sell diff --git a/apps/ledger-live-desktop/src/renderer/modals/Platform/Exchange/CompleteExchange/Body.tsx b/apps/ledger-live-desktop/src/renderer/modals/Platform/Exchange/CompleteExchange/Body.tsx index ff188d6d41dd..06aeffc04a0c 100644 --- a/apps/ledger-live-desktop/src/renderer/modals/Platform/Exchange/CompleteExchange/Body.tsx +++ b/apps/ledger-live-desktop/src/renderer/modals/Platform/Exchange/CompleteExchange/Body.tsx @@ -132,7 +132,7 @@ const Body = ({ data, onClose }: { data: Data; onClose?: () => void | undefined const onBroadcastSuccess = useCallback( (operation: Operation) => { - // Save swap history + // If swap we save to swap history and keep open the drawer if (swapId && toAccount && magnitudeAwareRate && sourceCurrency && targetCurrency) { const newResult = { operation, @@ -152,13 +152,18 @@ const Body = ({ data, onClose }: { data: Data; onClose?: () => void | undefined if (getEnv("DISABLE_TRANSACTION_BROADCAST")) { return onCancel(new DisabledTransactionBroadcastError()); } + onResult(operation); + // else not swap i.e card and sell we close the drawer + } else { + onResult(operation); + onClose?.(); } - onResult(operation); }, [ setResult, onResult, onCancel, + onClose, updateAccount, magnitudeAwareRate, provider,