Fix disappearing recipientAddress for XMR Transactions (#1784)
Some checks are pending
Cache Dependencies / test (push) Waiting to run

This commit is contained in:
Konstantin Ullrich 2024-10-30 17:57:26 +01:00 committed by GitHub
parent 5c206a8b7c
commit 198510533e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,18 +83,19 @@ abstract class TransactionDetailsViewModelBase with Store {
break;
}
if (showRecipientAddress && !isRecipientAddressShown) {
try {
final recipientAddress = transactionDescriptionBox.values
.firstWhere((val) => val.id == transactionInfo.txHash)
.recipientAddress;
final descriptionKey =
'${transactionInfo.txHash}_${wallet.walletAddresses.primaryAddress}';
final description = transactionDescriptionBox.values.firstWhere(
(val) => val.id == descriptionKey || val.id == transactionInfo.txHash,
orElse: () => TransactionDescription(id: descriptionKey));
if (recipientAddress?.isNotEmpty ?? false) {
items.add(StandartListItem(
title: S.current.transaction_details_recipient_address, value: recipientAddress!));
}
} catch (_) {
// FIX-ME: Unhandled exception
if (showRecipientAddress && !isRecipientAddressShown) {
final recipientAddress = description.recipientAddress;
if (recipientAddress?.isNotEmpty ?? false) {
items.add(StandartListItem(
title: S.current.transaction_details_recipient_address,
value: recipientAddress!));
}
}
@ -110,12 +111,6 @@ abstract class TransactionDetailsViewModelBase with Store {
} catch (e) {}
}));
final descriptionKey = '${transactionInfo.txHash}_${wallet.walletAddresses.primaryAddress}';
final description = transactionDescriptionBox.values.firstWhere(
(val) => val.id == descriptionKey || val.id == transactionInfo.txHash,
orElse: () => TransactionDescription(id: descriptionKey));
items.add(TextFieldListItem(
title: S.current.note_tap_to_change,
value: description.note,