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

[Fix/LIVE-12702]: Use targetAccountCurrency name if accountNameSelector returns null or undefined #6960

Merged
merged 4 commits into from
May 29, 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/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
Loading