Show message and not let user proceed when tapped on a token with balance 0 in the wallet tab

pull/547/head
Hwee-Boon Yar 6 years ago
parent 3f2867947e
commit e672ddf908
  1. 11
      AlphaWallet/InCoordinator.swift
  2. 1
      AlphaWallet/Localization/en.lproj/Localizable.strings
  3. 1
      AlphaWallet/Localization/es.lproj/Localizable.strings
  4. 1
      AlphaWallet/Localization/zh-Hans.lproj/Localizable.strings

@ -340,6 +340,11 @@ class InCoordinator: Coordinator {
return
}
guard !token.nonZeroBalance.isEmpty else {
navigationController.displayError(error: NoTokenError())
return
}
let session = transactionCoordinator.session
let tokenStorage = transactionCoordinator.tokensStorage
@ -632,3 +637,9 @@ extension InCoordinator: PromptBackupCoordinatorDelegate {
removeCoordinator(coordinator)
}
}
struct NoTokenError: LocalizedError {
var errorDescription: String? {
return R.string.localizable.aWalletNoTokens()
}
}

@ -205,6 +205,7 @@
"a.wallet.contents.filter.assetsOnly.title" = "ASSETS";
"a.wallet.contents.issuer.title" = "Issuer";
"a.wallet.next.button.title" = "Next";
"a.wallet.no.tokens" = "You don't have any tokens";
"a.help.navigation.title" = "Help & FAQs";
"a.help.contact.footer.button.title" = "Still need help? Contact Us";
"a.help.contact.email.subject" = "Help/Feedback for AlphaWallet";

@ -205,6 +205,7 @@
"a.wallet.contents.filter.assetsOnly.title" = "ASSETS";
"a.wallet.contents.issuer.title" = "Issuer";
"a.wallet.next.button.title" = "Next";
"a.wallet.no.tokens" = "You don't have any tokens";
"a.help.navigation.title" = "Help & FAQs";
"a.help.contact.footer.button.title" = "Still need help? Contact Us";
"a.help.contact.email.subject" = "Help/Feedback for AlphaWallet";

@ -205,6 +205,7 @@
"a.wallet.contents.filter.assetsOnly.title" = "资产类";
"a.wallet.contents.issuer.title" = "发行方";
"a.wallet.next.button.title" = "下一步";
"a.wallet.no.tokens" = "You don't have any tokens";
"a.help.navigation.title" = "帮助";
"a.help.contact.footer.button.title" = "需要进一步帮助? 联系我们";
"a.help.contact.email.subject" = "帮助/建议";

Loading…
Cancel
Save