From bc52cf485e52733f95bad6b187820a5bbcf4a825 Mon Sep 17 00:00:00 2001 From: cyan Date: Thu, 15 May 2025 18:48:43 +0200 Subject: [PATCH] fix(cw_monero): transaction not appearing after send (#2268) * fix: catch error in newly added fetchTransactions call fix: null handling in cw_monero * fix(cw_monero): transaction not appearing after send --- cw_monero/lib/monero_wallet.dart | 2 +- cw_monero/lib/pending_monero_transaction.dart | 7 ++++++- lib/view_model/send/send_view_model.dart | 7 ------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/cw_monero/lib/monero_wallet.dart b/cw_monero/lib/monero_wallet.dart index 7a4d943fe..c3433a4c9 100644 --- a/cw_monero/lib/monero_wallet.dart +++ b/cw_monero/lib/monero_wallet.dart @@ -446,7 +446,7 @@ abstract class MoneroWalletBase extends WalletBase pendingTransactionDescription.hash; @@ -54,6 +56,7 @@ class PendingMoneroTransaction with PendingTransaction { rethrow; } + await wallet.fetchTransactions(); storeSync(force: true); } @@ -63,6 +66,8 @@ class PendingMoneroTransaction with PendingTransaction { final ret = monero_transaction_history.commitTransactionFromPointerAddress( address: pendingTransactionDescription.pointerAddress, useUR: true); + await wallet.fetchTransactions(); + storeSync(force: true); return ret; } catch (e) { final message = e.toString(); diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index a675042e3..94b3618ce 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -593,13 +593,6 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor } final sharedPreferences = await SharedPreferences.getInstance(); await sharedPreferences.setString(PreferencesKey.backgroundSyncLastTrigger(wallet.name), DateTime.now().add(Duration(minutes: 1)).toIso8601String()); - unawaited(() { - try { - wallet.fetchTransactions(); - } catch (e) { - printV(e); - } - }()); state = TransactionCommitted(); } catch (e) { state = FailureState(translateErrorMessage(e, wallet.type, wallet.currency));