Skip to content

Commit 4789654

Browse files
committed
ui(spl): mobile sol token wallet nav
1 parent 4030002 commit 4789654

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

lib/pages/wallets_view/sub_widgets/wallet_list_item.dart

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ import '../../../utilities/show_loading.dart';
2424
import '../../../utilities/show_node_tor_settings_mismatch.dart';
2525
import '../../../utilities/text_styles.dart';
2626
import '../../../utilities/util.dart';
27+
import '../../../wallets/crypto_currency/coins/solana.dart';
2728
import '../../../wallets/crypto_currency/crypto_currency.dart';
29+
import '../../../wallets/isar/providers/wallet_info_provider.dart';
2830
import '../../../wallets/wallet/intermediate/external_wallet.dart';
2931
import '../../../widgets/dialogs/tor_warning_dialog.dart';
3032
import '../../../widgets/rounded_white_container.dart';
@@ -80,7 +82,23 @@ class WalletListItem extends ConsumerWidget {
8082
}
8183
}
8284

83-
if (walletCount == 1 && coin is! Ethereum) {
85+
// Check if we should show the wallets overview or open wallet directly.
86+
bool shouldShowWalletsOverview = walletCount > 1 || coin is Ethereum;
87+
88+
// For Solana and other token-supporting coins, check if any wallet has tokens.
89+
if (!shouldShowWalletsOverview && coin.hasTokenSupport) {
90+
final wallet = ref
91+
.read(pWallets)
92+
.wallets
93+
.firstWhere((e) => e.info.coin == coin);
94+
95+
final tokenAddresses = ref.read(pWalletTokenAddresses(wallet.walletId));
96+
if (tokenAddresses.isNotEmpty) {
97+
shouldShowWalletsOverview = true;
98+
}
99+
}
100+
101+
if (walletCount == 1 && !shouldShowWalletsOverview) {
84102
final wallet = ref
85103
.read(pWallets)
86104
.wallets

0 commit comments

Comments
 (0)