fix: catch error in newly added fetchTransactions call (#2265)

fix: null handling in cw_monero
This commit is contained in:
cyan
2025-05-15 02:07:17 +03:00
committed by GitHub
parent ca8dbf3c81
commit 40084ec532
2 changed files with 12 additions and 6 deletions
+7 -1
View File
@@ -593,7 +593,13 @@ 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(wallet.fetchTransactions());
unawaited(() {
try {
wallet.fetchTransactions();
} catch (e) {
printV(e);
}
}());
state = TransactionCommitted();
} catch (e) {
state = FailureState(translateErrorMessage(e, wallet.type, wallet.currency));