Display ERC 20 token name from TokenScript file instead of the contract in the send screen (like in the Wallet tab), if the file is available

pull/1542/head
Hwee-Boon Yar 5 years ago
parent 3c963655a5
commit fc3d76db5f
  1. 3
      AlphaWallet/Tokens/ViewControllers/TokenViewController.swift
  2. 3
      AlphaWallet/Transfer/ViewControllers/SendViewController.swift

@ -153,7 +153,8 @@ class TokenViewController: UIViewController {
case .ERC20Token(let token, _, _):
let viewModel = BalanceTokenViewModel(token: token)
let amount = viewModel.amountShort
headerViewModel.title = "\(amount) \(viewModel.name) (\(viewModel.symbol))"
//Note that if we want to display the token name directly from token.name, we have to be careful that DAI token's name has trailing \0
headerViewModel.title = "\(amount) \(token.titleInPluralForm(withAssetDefinitionStore: assetDefinitionStore))"
let etherToken = TokensDataStore.etherToken(forServer: session.server)
let ticker = tokensDataStore.coinTicker(for: etherToken)
headerViewModel.ticker = ticker

@ -254,7 +254,8 @@ class SendViewController: UIViewController, CanScanQRCode {
case .ERC20Token(let token, _, _):
let viewModel = BalanceTokenViewModel(token: token)
let amount = viewModel.amountShort
headerViewModel.title = "\(amount) \(viewModel.name) (\(viewModel.symbol))"
//Note that if we want to display the token name directly from token.name, we have to be careful that DAI token's name has trailing \0
headerViewModel.title = "\(amount) \(token.titleInPluralForm(withAssetDefinitionStore: assetDefinitionStore))"
let etherToken = TokensDataStore.etherToken(forServer: session.server)
let ticker = storage.coinTicker(for: etherToken)
headerViewModel.ticker = ticker

Loading…
Cancel
Save