Skip to content

Commit

Permalink
[Fix/LIVE-12702]: Use targetAccountCurrency name if accountNameSelect…
Browse files Browse the repository at this point in the history
…or returns null or undefined (#6960)

* fix: use targetAccountCurrency name if accountNameSelector returns null or undefined

* chore: changeset

* fix: if token account, then include parent account name

* Revert "fix: if token account, then include parent account name"

This reverts commit fc43907.
  • Loading branch information
kallen-ledger committed May 29, 2024
1 parent 8ac9cf1 commit 9a2ce48
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-elephants-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Use targetAccountCurrency name if accountNameSelector returns null or undefined.
Original file line number Diff line number Diff line change
Expand Up @@ -964,9 +964,14 @@ export const renderSwapDeviceConfirmation = ({
const sourceAccountName = accountNameSelector(walletState, {
accountId: exchange.fromAccount.id,
});
const targetAccountName = accountNameSelector(walletState, {
accountId: exchange.toAccount.id,
});

// If account exists already then grab the name set.
// However if account has not yet been set then use the
// crypto/token currency name as the target account.
const targetAccountName =
accountNameSelector(walletState, {
accountId: exchange.toAccount.id,
}) ?? targetAccountCurrency.name;

const providerName = getProviderName(exchangeRate.provider);
const noticeType = getNoticeType(exchangeRate.provider);
Expand Down

0 comments on commit 9a2ce48

Please sign in to comment.