mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
fix: catch error in newly added fetchTransactions call (#2265)
fix: null handling in cw_monero
This commit is contained in:
parent
ca8dbf3c81
commit
40084ec532
2 changed files with 12 additions and 6 deletions
|
@ -139,16 +139,16 @@ String getAddress({int accountIndex = 0, int addressIndex = 0}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int getFullBalance({int accountIndex = 0}) =>
|
int getFullBalance({int accountIndex = 0}) =>
|
||||||
currentWallet!.balance(accountIndex: accountIndex);
|
currentWallet?.balance(accountIndex: accountIndex) ?? 0;
|
||||||
|
|
||||||
int getUnlockedBalance({int accountIndex = 0}) =>
|
int getUnlockedBalance({int accountIndex = 0}) =>
|
||||||
currentWallet!.unlockedBalance(accountIndex: accountIndex);
|
currentWallet?.unlockedBalance(accountIndex: accountIndex) ?? 0;
|
||||||
|
|
||||||
int getCurrentHeight() => currentWallet!.blockChainHeight();
|
int getCurrentHeight() => currentWallet?.blockChainHeight() ?? 0;
|
||||||
|
|
||||||
int getNodeHeightSync() => currentWallet!.daemonBlockChainHeight();
|
int getNodeHeightSync() => currentWallet?.daemonBlockChainHeight() ?? 0;
|
||||||
|
|
||||||
bool isConnectedSync() => currentWallet!.connected() != 0;
|
bool isConnectedSync() => currentWallet?.connected() != 0;
|
||||||
|
|
||||||
Future<bool> setupNodeSync(
|
Future<bool> setupNodeSync(
|
||||||
{required String address,
|
{required String address,
|
||||||
|
|
|
@ -593,7 +593,13 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||||
}
|
}
|
||||||
final sharedPreferences = await SharedPreferences.getInstance();
|
final sharedPreferences = await SharedPreferences.getInstance();
|
||||||
await sharedPreferences.setString(PreferencesKey.backgroundSyncLastTrigger(wallet.name), DateTime.now().add(Duration(minutes: 1)).toIso8601String());
|
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();
|
state = TransactionCommitted();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
state = FailureState(translateErrorMessage(e, wallet.type, wallet.currency));
|
state = FailureState(translateErrorMessage(e, wallet.type, wallet.currency));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue