Show loading
This commit is contained in:
parent
68c60a29ba
commit
48adb80252
|
|
@ -10,6 +10,7 @@ import 'package:invoiceninja_flutter/redux/auth/auth_actions.dart';
|
|||
import 'package:invoiceninja_flutter/redux/company/company_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/dialogs/error_dialog.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/dialogs/loading_dialog.dart';
|
||||
import 'package:invoiceninja_flutter/ui/settings/account_management.dart';
|
||||
import 'package:invoiceninja_flutter/utils/completers.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
|
|
@ -54,6 +55,13 @@ class AccountManagementVM {
|
|||
onCompanyChanged: (company) =>
|
||||
store.dispatch(UpdateCompany(company: company)),
|
||||
onCompanyDelete: (context, password) {
|
||||
showDialog<AlertDialog>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) => SimpleDialog(
|
||||
children: <Widget>[LoadingDialog()],
|
||||
));
|
||||
|
||||
final deleteCompleter = Completer<Null>()
|
||||
..future.then((value) {
|
||||
final refreshCompleter = Completer<Null>()
|
||||
|
|
@ -62,6 +70,10 @@ class AccountManagementVM {
|
|||
store.dispatch(SelectCompany(companyIndex: 0));
|
||||
store.dispatch(
|
||||
ViewDashboard(navigator: Navigator.of(context)));
|
||||
|
||||
if (Navigator.of(context).canPop()) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
} else {
|
||||
print('## No companies');
|
||||
store.dispatch(UserLogout(context));
|
||||
|
|
|
|||
Loading…
Reference in New Issue