Update dashboard_view_model.dart

This commit is contained in:
Serhii 2025-03-07 14:48:36 +02:00
parent e3e0845d8e
commit 8009ee061c

View file

@ -253,33 +253,34 @@ abstract class DashboardViewModelBase with Store {
_checkMweb();
});
connectMapToListWithTransform(
appStore.wallet!.transactionHistory.transactions,
transactions,
(TransactionInfo? transaction) => TransactionListItem(
transaction: transaction!,
balanceViewModel: balanceViewModel,
settingsStore: appStore.settingsStore,
key: ValueKey(
'${_wallet.type.name}_transaction_history_item_${transaction.id}_key',
_transactionDisposer?.reaction.dispose();
_transactionDisposer = reaction(
(_) => appStore.wallet!.transactionHistory.transactions.values.toList(),
(List<TransactionInfo> txs) {
transactions.clear();
transactions.addAll(
txs.where((tx) {
if (wallet.type == WalletType.monero) {
return monero!.getTransactionInfoAccountId(tx) == monero!.getCurrentAccount(wallet).id;
}
if (wallet.type == WalletType.wownero) {
return wow.wownero!.getTransactionInfoAccountId(tx) == wow.wownero!.getCurrentAccount(wallet).id;
}
return true;
}).map(
(tx) => TransactionListItem(
transaction: tx,
balanceViewModel: balanceViewModel,
settingsStore: appStore.settingsStore,
key: ValueKey('${wallet.type.name}_transaction_history_item_${tx.id}_key'),
),
), filter: (TransactionInfo? transaction) {
if (transaction == null) {
return false;
}
final wallet = _wallet;
if (wallet.type == WalletType.monero) {
return monero!.getTransactionInfoAccountId(transaction) ==
monero!.getCurrentAccount(wallet).id;
}
if (wallet.type == WalletType.wownero) {
return wow.wownero!.getTransactionInfoAccountId(transaction) ==
wow.wownero!.getCurrentAccount(wallet).id;
}
return true;
});
),
);
}
);
if (hasSilentPayments) {
silentPaymentsScanningActive = bitcoin!.getScanningActive(wallet);