CAKE-294 | wallet saved when accounts and subaddresses are changed

This commit is contained in:
OleksandrSobol 2021-03-30 19:43:07 +03:00
parent 4a62e2db33
commit a1fe786af2

View file

@ -100,8 +100,10 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance> with Store {
Future<void> init() async { Future<void> init() async {
accountList.update(); accountList.update();
accountList.accounts.observe((_) async => await save());
account = accountList.accounts.first; account = accountList.accounts.first;
subaddressList.update(accountIndex: account.id ?? 0); subaddressList.update(accountIndex: account.id ?? 0);
subaddressList.subaddresses.observe((_) async => await save());
subaddress = subaddressList.getAll().first; subaddress = subaddressList.getAll().first;
balance = MoneroBalance( balance = MoneroBalance(
fullBalance: monero_wallet.getFullBalance(accountIndex: account.id), fullBalance: monero_wallet.getFullBalance(accountIndex: account.id),