fix: sp filter option (#1780)

* fix: sp filter option

* fix: nullable
This commit is contained in:
Rafael 2024-11-01 14:34:17 -03:00 committed by GitHub
parent 752b6bbebf
commit 740f466e77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 8 deletions

View file

@ -91,8 +91,9 @@ abstract class TransactionFilterStoreBase with Store {
(displayOutgoing && item.transaction.direction == TransactionDirection.outgoing) ||
(displayIncoming &&
item.transaction.direction == TransactionDirection.incoming &&
!bitcoin!.txIsReceivedSilentPayment(item.transaction)) ||
(displaySilentPayments && bitcoin!.txIsReceivedSilentPayment(item.transaction));
!(bitcoin?.txIsReceivedSilentPayment(item.transaction) ?? false)) ||
(displaySilentPayments &&
(bitcoin?.txIsReceivedSilentPayment(item.transaction) ?? false));
} else if (item is AnonpayTransactionListItem) {
allowed = displayIncoming;
}

View file

@ -90,11 +90,12 @@ abstract class DashboardViewModelBase with Store {
value: () => transactionFilterStore.displayOutgoing,
caption: S.current.outgoing,
onChanged: transactionFilterStore.toggleOutgoing),
FilterItem(
value: () => transactionFilterStore.displaySilentPayments,
caption: S.current.silent_payments,
onChanged: transactionFilterStore.toggleSilentPayments,
),
if (appStore.wallet!.type == WalletType.bitcoin)
FilterItem(
value: () => transactionFilterStore.displaySilentPayments,
caption: S.current.silent_payments,
onChanged: transactionFilterStore.toggleSilentPayments,
),
// FilterItem(
// value: () => false,
// caption: S.current.transactions_by_date,
@ -435,7 +436,10 @@ abstract class DashboardViewModelBase with Store {
}
@computed
bool get hasMweb => wallet.type == WalletType.litecoin && (Platform.isIOS || Platform.isAndroid) && !wallet.isHardwareWallet;
bool get hasMweb =>
wallet.type == WalletType.litecoin &&
(Platform.isIOS || Platform.isAndroid) &&
!wallet.isHardwareWallet;
@computed
bool get showMwebCard => hasMweb && settingsStore.mwebCardDisplay && !mwebEnabled;