fix: sp filter option (#1780)
* fix: sp filter option * fix: nullable
Rafael committed
Nov 1, 2024 at 14:34 UTC
740f466e77464090f1e4c9457f3c4abeb7c2181e
2 files changed
+13
-8
lib/store/dashboard/transaction_filter_store.dart
+3
-2
@@ -91,8 +91,9 @@ abstract class TransactionFilterStoreBase with Store {
91
(displayOutgoing && item.transaction.direction == TransactionDirection.outgoing) ||
92
(displayIncoming &&
93
item.transaction.direction == TransactionDirection.incoming &&
94
- !bitcoin!.txIsReceivedSilentPayment(item.transaction)) ||
95
- (displaySilentPayments && bitcoin!.txIsReceivedSilentPayment(item.transaction));
94
+ !(bitcoin?.txIsReceivedSilentPayment(item.transaction) ?? false)) ||
95
+ (displaySilentPayments &&
96
+ (bitcoin?.txIsReceivedSilentPayment(item.transaction) ?? false));
97
} else if (item is AnonpayTransactionListItem) {
98
allowed = displayIncoming;
99
}
lib/view_model/dashboard/dashboard_view_model.dart
+10
-6
@@ -90,11 +90,12 @@ abstract class DashboardViewModelBase with Store {
90
value: () => transactionFilterStore.displayOutgoing,
91
caption: S.current.outgoing,
92
onChanged: transactionFilterStore.toggleOutgoing),
93
- FilterItem(
94
- value: () => transactionFilterStore.displaySilentPayments,
95
- caption: S.current.silent_payments,
96
- onChanged: transactionFilterStore.toggleSilentPayments,
97
- ),
93
+ if (appStore.wallet!.type == WalletType.bitcoin)
94
+ FilterItem(
95
+ value: () => transactionFilterStore.displaySilentPayments,
96
+ caption: S.current.silent_payments,
97
+ onChanged: transactionFilterStore.toggleSilentPayments,
98
+ ),
99
// FilterItem(
100
// value: () => false,
101
// caption: S.current.transactions_by_date,
@@ -435,7 +436,10 @@ abstract class DashboardViewModelBase with Store {
436
}
437
438
@computed
438
- bool get hasMweb => wallet.type == WalletType.litecoin && (Platform.isIOS || Platform.isAndroid) && !wallet.isHardwareWallet;
439
+ bool get hasMweb =>
440
+ wallet.type == WalletType.litecoin &&
441
+ (Platform.isIOS || Platform.isAndroid) &&
442
+ !wallet.isHardwareWallet;
443
444
@computed
445
bool get showMwebCard => hasMweb && settingsStore.mwebCardDisplay && !mwebEnabled;