Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- changed: Some unecessary `showError` dropdowns demoted to hidden `showDevError`
- fixed: Default swap pair logic from the trade modal was not prioritizing mainnet assets
- removed: 'fasterpayments' payment type

## 4.12.0
Expand Down
2 changes: 1 addition & 1 deletion src/components/themed/TransactionListTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export class TransactionListTopComponent extends React.PureComponent<Props, Stat
// priority assets for swapping.
const isPriorityAssetMatch =
currencyWallet.currencyInfo.pluginId === priorityAsset.pluginId &&
currencyWallet.enabledTokenIds.some(enabledTokenId => enabledTokenId === priorityAsset.tokenId)
(priorityAsset.tokenId == null || currencyWallet.enabledTokenIds.some(enabledTokenId => enabledTokenId === priorityAsset.tokenId))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of Array.some, try Array.includes on the right-Rand side. Much simpler.


// If the wallet or enabled tokens has a priority swap asset match,
// calculate its USD value and add it to the ownedAssets array along
Expand Down