This commit is contained in:
M
2020-10-24 15:55:24 +03:00
parent 0c197660a8
commit 588d93c1a4
6 changed files with 82 additions and 85 deletions
@@ -138,7 +138,9 @@ abstract class DashboardViewModelBase with Store {
appStore.settingsStore.balanceDisplayMode;
@computed
List<TradeListItem> get trades => tradesStore.trades;
List<TradeListItem> get trades => tradesStore.trades
.where((trade) => trade.trade.walletId == wallet.id)
.toList();
@computed
double get price => balanceViewModel.price;
@@ -153,6 +155,7 @@ abstract class DashboardViewModelBase with Store {
return formattedItemsList(_items);
}
@observable
WalletBase wallet;
BalanceViewModel balanceViewModel;
@@ -174,7 +177,9 @@ abstract class DashboardViewModelBase with Store {
await wallet.connectToNode(node: node);
}
@action
void _onWalletChange(WalletBase wallet) {
this.wallet = wallet;
name = wallet.name;
transactions.clear();
transactions.addAll(wallet.transactionHistory.transactions.values.map(
@@ -137,7 +137,7 @@ abstract class ExchangeViewModelBase with Store {
return;
}
final _amount = double.parse(amount) ?? 0;
final _amount = double.parse(amount.replaceAll(',', '.')) ?? 0;
provider
.calculateAmount(
@@ -160,7 +160,7 @@ abstract class ExchangeViewModelBase with Store {
return;
}
final _amount = double.parse(amount);
final _amount = double.parse(amount.replaceAll(',', '.'));
provider
.calculateAmount(
from: depositCurrency, to: receiveCurrency, amount: _amount,