[LWD] fix(text): 🐛 text showing wrong text when adding new token#15620
[LWD] fix(text): 🐛 text showing wrong text when adding new token#15620
Conversation
Web Tools Build Status
|
There was a problem hiding this comment.
Pull request overview
Fixes the account empty-state wording on desktop so token-related wording displays correctly when viewing/adding certain token accounts (notably Hedera/Algorand), instead of showing an unresolved {{tokenList}} placeholder.
Changes:
- Adjust token type source in the empty-state token description to use the parent currency token types for
TokenAccount. - Add a Changesets entry for the desktop package release notes/versioning.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| apps/ledger-live-desktop/src/renderer/screens/account/EmptyStateAccount.tsx | Updates token-list rendering logic in the empty-state description for token accounts. |
| .changeset/curly-carpets-smile.md | Adds a changeset documenting the fix for release/versioning. |
| <Text ff="Inter|SemiBold" color="neutral.c100"> | ||
| {account && | ||
| account.type === "Account" && | ||
| (account.currency.tokenTypes || []).join(", ")} | ||
| account.type === "TokenAccount" && | ||
| (account.token.parentCurrency.tokenTypes || []).join(", ")} |
There was a problem hiding this comment.
account.emptyState.descToken in en/app.json interpolates {{tokenList}}, but this <Trans> call still doesn't pass a values.tokenList. As a result, the UI can still render the literal {{tokenList}} (the original bug). Pass values={{ tokenList: ... }} to Trans (and consider passing the other interpolations too) rather than trying to inject the text via children only.
| {account && | ||
| account.type === "Account" && | ||
| (account.currency.tokenTypes || []).join(", ")} | ||
| account.type === "TokenAccount" && | ||
| (account.token.parentCurrency.tokenTypes || []).join(", ")} |
There was a problem hiding this comment.
The hasTokens condition is based on mainAccount.subAccounts, but the token list is now only rendered when account.type === "TokenAccount". When the empty state is shown for a main Account that has token subaccounts, this will render no token list. Consider deriving token types from mainAccount.currency (or handling both Account and TokenAccount) so the wording is correct in both contexts.
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "ledger-live-desktop": minor | |||
There was a problem hiding this comment.
This changeset is describing a bug fix; using a patch bump is likely more appropriate than minor to avoid triggering a larger-than-needed version increment for desktop.
| "ledger-live-desktop": minor | |
| "ledger-live-desktop": patch |
50f89b9 to
4f24c3a
Compare
|
| <Text ff="Inter|SemiBold" color="neutral.c100"> | ||
| {account && | ||
| account.type === "Account" && | ||
| (account.currency.tokenTypes || []).join(", ")} | ||
| account.type === "TokenAccount" && | ||
| (account.token.parentCurrency.tokenTypes || []).join(", ")} | ||
| {"tokens"} |
There was a problem hiding this comment.
In the hasTokens branch, account can be a main Account (not a TokenAccount) when the empty state is rendered on a parent account. With the new account.type === "TokenAccount" guard, the token type list becomes empty and the UI will render only the trailing "tokens" label. Consider deriving token types from mainAccount.currency.tokenTypes (works for both Account and TokenAccount views because mainAccount is the parent) or handling both account types explicitly.
|



✅ Checklist
npx changesetwas attached.📝 Description
{{tokenList}} should be replaced by token name.
We were doing wrong check, account type must be
TokenAccountand useaccount.token.parentCurrency.tokenTypesinstead ofaccount.currency.tokenTypesBEFORE
AFTER
❓ Context
🧐 Checklist for the PR Reviewers