mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
fix: calling SP check on other wallet types transactions
This commit is contained in:
+1
-1
@@ -348,7 +348,7 @@ Future<void> setup({
|
||||
getIt.registerSingleton<OrdersStore>(
|
||||
OrdersStore(ordersSource: _ordersSource, settingsStore: getIt.get<SettingsStore>()));
|
||||
getIt.registerSingleton<TradeFilterStore>(TradeFilterStore());
|
||||
getIt.registerSingleton<TransactionFilterStore>(TransactionFilterStore());
|
||||
getIt.registerSingleton<TransactionFilterStore>(TransactionFilterStore(getIt.get<AppStore>()));
|
||||
getIt.registerSingleton<FiatConversionStore>(FiatConversionStore());
|
||||
getIt.registerSingleton<SendTemplateStore>(SendTemplateStore(templateSource: _templates));
|
||||
getIt.registerSingleton<ExchangeTemplateStore>(
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'package:cake_wallet/bitcoin/bitcoin.dart';
|
||||
import 'package:cake_wallet/store/app_store.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/action_list_item.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/anonpay_transaction_list_item.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cw_core/transaction_direction.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/transaction_list_item.dart';
|
||||
@@ -10,11 +12,13 @@ part 'transaction_filter_store.g.dart';
|
||||
class TransactionFilterStore = TransactionFilterStoreBase with _$TransactionFilterStore;
|
||||
|
||||
abstract class TransactionFilterStoreBase with Store {
|
||||
TransactionFilterStoreBase()
|
||||
TransactionFilterStoreBase(this._appStore)
|
||||
: displayIncoming = true,
|
||||
displayOutgoing = true,
|
||||
displaySilentPayments = true;
|
||||
|
||||
final AppStore _appStore;
|
||||
|
||||
@observable
|
||||
bool displayIncoming;
|
||||
|
||||
@@ -87,13 +91,15 @@ abstract class TransactionFilterStoreBase with Store {
|
||||
|
||||
if (allowed && (!displayAll)) {
|
||||
if (item is TransactionListItem) {
|
||||
final canShowSilentPayment = _appStore.wallet?.type == WalletType.bitcoin &&
|
||||
(bitcoin?.txIsReceivedSilentPayment(item.transaction) ?? false);
|
||||
|
||||
allowed =
|
||||
(displayOutgoing && item.transaction.direction == TransactionDirection.outgoing) ||
|
||||
(displayIncoming &&
|
||||
item.transaction.direction == TransactionDirection.incoming &&
|
||||
!(bitcoin?.txIsReceivedSilentPayment(item.transaction) ?? false)) ||
|
||||
(displaySilentPayments &&
|
||||
(bitcoin?.txIsReceivedSilentPayment(item.transaction) ?? false));
|
||||
!canShowSilentPayment) ||
|
||||
(displaySilentPayments && canShowSilentPayment);
|
||||
} else if (item is AnonpayTransactionListItem) {
|
||||
allowed = displayIncoming;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user