Skip to content

Commit

Permalink
Merge pull request #1621 from AmbireTech/fix/transfer-native-change
Browse files Browse the repository at this point in the history
Fix selected token on transfer screen from dashboard
  • Loading branch information
Ivshti authored Jun 24, 2024
2 parents 16c07df + 076ad32 commit fdc2e66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Wallet/Transfer/Transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ const Transfer = (props) => {
const { state } = useLocation()
const { tokenAddressOrSymbol } = useParams()

const [selectedAsset, setSelectedAsset] = useState(null)
const initialSelectedAsset = portfolio.tokens.find(({ address: itemAddress, symbol }) =>
[itemAddress, symbol].includes(tokenAddressOrSymbol))

const [selectedAsset, setSelectedAsset] = useState(initialSelectedAsset)

const [assetAddrWithSymbol, setAsset] = useState(
selectedAsset && `${selectedAsset.address}:${selectedAsset.symbol}`
)
Expand Down

0 comments on commit fdc2e66

Please sign in to comment.