Resolves #118 Fix message queue issue

This commit is contained in:
Yegor Vialov
2018-10-07 12:14:48 +03:00
parent 253316fb1f
commit 70b6469bd1
2 changed files with 10 additions and 5 deletions

View File

@ -202,6 +202,7 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver {
}
_refreshData() async {
_hideErrorSnackBar();
_homeAssistant.updateConnectionSettings(_apiEndpoint, _apiPassword, _authType);
setState(() {
_isLoading = 1;
@ -370,7 +371,11 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver {
);
}
_showErrorSnackBar({Key key, @required String message, @required int errorCode}) {
void _hideErrorSnackBar() {
_scaffoldKey?.currentState?.hideCurrentSnackBar();
}
void _showErrorSnackBar({Key key, @required String message, @required int errorCode}) {
SnackBarAction action;
switch (errorCode) {
case 9: