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.
This commit is contained in:
jwinterm
2026-05-17 20:03:07 -04:00
parent f1fffddf90
commit 3faa89d49d
@@ -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);
}