From 3faa89d49d7f600c7907e9244ffdcf80f82ad0c7 Mon Sep 17 00:00:00 2001 From: jwinterm Date: Sun, 17 May 2026 20:03:07 -0400 Subject: [PATCH] Wownero: route MoneroAccountListViewModel.selected to wownero API The .selected computed getter always called monero!.getCurrentAccount(_wallet), which does an internal 'wallet as MoneroWallet' cast and threw 'WowneroWallet is not a subtype of MoneroWallet' whenever the dashboard CardsView Observer rebuilt for a Wownero wallet. The .accounts getter above already dispatched correctly by wallet.type; .selected didn't. Now matches the same monero/wownero dispatch pattern. --- .../monero_account_list/monero_account_list_view_model.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/view_model/monero_account_list/monero_account_list_view_model.dart b/lib/view_model/monero_account_list/monero_account_list_view_model.dart index e89caefe1..e6ecd9251 100644 --- a/lib/view_model/monero_account_list/monero_account_list_view_model.dart +++ b/lib/view_model/monero_account_list/monero_account_list_view_model.dart @@ -58,7 +58,9 @@ abstract class MoneroAccountListViewModelBase with Store { @computed AccountListItem get selected { - final currentId = monero!.getCurrentAccount(_wallet).id; + final currentId = _wallet.type == WalletType.wownero + ? wownero!.getCurrentAccount(_wallet).id + : monero!.getCurrentAccount(_wallet).id; return accounts.firstWhere((item) => item.id == currentId); }