Исправлено падение приложения из-за попытки сделать запрос к бд, после закрытия соединения с ней

This commit is contained in:
Ivan Murashov
2017-09-26 11:35:30 +03:00
parent 9f2bf14199
commit 7a1dc84fa1
5 changed files with 40 additions and 40 deletions

View File

@@ -129,7 +129,7 @@ class _SplashScreenState extends BaseState<SplashScreen> {
getCheckTokenStatusRequest(token).then((statusResponse) {
handleStatusResponse(statusResponse, helper);
}).catchError((error) {
handleError(error.toString());
print(error.toString());
});
}
}
@@ -179,7 +179,7 @@ class _SplashScreenState extends BaseState<SplashScreen> {
clearToken(response, helper);
}
}).catchError((error) {
handleError(error.toString());
print(error.toString());
});
}
@@ -191,16 +191,8 @@ class _SplashScreenState extends BaseState<SplashScreen> {
Navigator.of(context).pop();
pushRouteReplacement(context, new RegistrationScreen(helper, app));
}).catchError((error) {
handleError(error.toString());
print(error.toString());
});
});
}
/// Закрываем соединение, логируем ошибку.
void handleError(String error) {
helper.close().then((_) {
print(error.toString());
return false;
});
}
}