mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-24 10:54:13 +01:00
CW 1080: fix(cw_monero): call store() directly after commiting tx (#2312)
* fix(cw_monero): call store() directly after commiting tx to make sure that tx key is written to cache also, store it in TransactionDescription hive box * Update lib/view_model/send/send_view_model.dart --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
@@ -590,16 +590,25 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||
}
|
||||
|
||||
if (pendingTransaction!.id.isNotEmpty) {
|
||||
TransactionInfo? tx;
|
||||
if (walletType == WalletType.monero) {
|
||||
await Future.delayed(Duration(milliseconds: 450));
|
||||
await wallet.fetchTransactions();
|
||||
final txhistory = monero!.getTransactionHistory(wallet);
|
||||
tx = txhistory.transactions.values.last;
|
||||
}
|
||||
final descriptionKey = '${pendingTransaction!.id}_${wallet.walletAddresses.primaryAddress}';
|
||||
_settingsStore.shouldSaveRecipientAddress
|
||||
? await transactionDescriptionBox.add(TransactionDescription(
|
||||
id: descriptionKey,
|
||||
recipientAddress: address,
|
||||
transactionNote: note,
|
||||
transactionKey: tx?.additionalInfo["key"] as String?,
|
||||
))
|
||||
: await transactionDescriptionBox.add(TransactionDescription(
|
||||
id: descriptionKey,
|
||||
transactionNote: note,
|
||||
transactionKey: tx?.additionalInfo["key"] as String?,
|
||||
));
|
||||
}
|
||||
final sharedPreferences = await SharedPreferences.getInstance();
|
||||
|
||||
Reference in New Issue
Block a user