recoverFromError method

Future<void> recoverFromError ()

Implementation

Future<void> recoverFromError() async {
  await Future.delayed(Duration(milliseconds: 100));
  status = DataBackendStatus.LOADING;
  notifyListeners();
  await maybeRefresh(silent: true);
  if (status == DataBackendStatus.ERROR) {
    creditCards = [];
    creditCardTemplates = getLocalCreditCardTemplates();
    status = DataBackendStatus.AVAILABLE;
  }
  notifyListeners();
}