mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user