Correct description if user has eth wallets but they already have the token

This commit is contained in:
julian 2023-03-29 15:36:49 -06:00
parent d2d3531102
commit 46af7c2639

View file

@ -43,6 +43,7 @@ class _SelectWalletForTokenViewState
extends ConsumerState<SelectWalletForTokenView> { extends ConsumerState<SelectWalletForTokenView> {
final isDesktop = Util.isDesktop; final isDesktop = Util.isDesktop;
late final List<String> ethWalletIds; late final List<String> ethWalletIds;
bool _hasEthWallets = false;
String? _selectedWalletId; String? _selectedWalletId;
@ -75,6 +76,8 @@ class _SelectWalletForTokenViewState
walletsData.removeWhere((key, value) => value.coin != widget.entity.coin); walletsData.removeWhere((key, value) => value.coin != widget.entity.coin);
ethWalletIds.clear(); ethWalletIds.clear();
_hasEthWallets = walletsData.isNotEmpty;
// TODO: proper wallet data class instead of this Hive silliness // TODO: proper wallet data class instead of this Hive silliness
for (final walletId in walletsData.values.map((e) => e.walletId).toList()) { for (final walletId in walletsData.values.map((e) => e.walletId).toList()) {
final walletContracts = DB.instance.get<dynamic>( final walletContracts = DB.instance.get<dynamic>(
@ -179,7 +182,9 @@ class _SelectWalletForTokenViewState
ethWalletIds.isEmpty ethWalletIds.isEmpty
? RoundedWhiteContainer( ? RoundedWhiteContainer(
child: Text( child: Text(
"You do not have any Ethereum wallets", _hasEthWallets
? "All current Ethereum wallets already have ${widget.entity.name}"
: "You do not have any Ethereum wallets",
style: STextStyles.label(context), style: STextStyles.label(context),
), ),
) )