Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cherrypick: #6664 #6693

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rich-windows-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

bugfix: close exchangeComplete for card sell
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Loading