Bug when deleting company
This commit is contained in:
parent
979457eeef
commit
e46ab5e0fd
|
|
@ -294,8 +294,8 @@ Middleware<AppState> _deleteCompany(AuthRepository repository) {
|
||||||
password: action.password,
|
password: action.password,
|
||||||
companyId: state.company.id)
|
companyId: state.company.id)
|
||||||
.then((dynamic value) {
|
.then((dynamic value) {
|
||||||
action.completer.complete(null);
|
|
||||||
store.dispatch(DeleteCompanySuccess());
|
store.dispatch(DeleteCompanySuccess());
|
||||||
|
action.completer.complete(null);
|
||||||
}).catchError((Object error) {
|
}).catchError((Object error) {
|
||||||
store.dispatch(DeleteCompanyFailure(error));
|
store.dispatch(DeleteCompanyFailure(error));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,7 @@ class DeleteCompanyRequest implements StartSaving {
|
||||||
final String password;
|
final String password;
|
||||||
}
|
}
|
||||||
|
|
||||||
class DeleteCompanySuccess implements StopSaving, PersistData {
|
class DeleteCompanySuccess implements StopSaving, PersistData {}
|
||||||
DeleteCompanySuccess();
|
|
||||||
}
|
|
||||||
|
|
||||||
class DeleteCompanyFailure implements StopSaving {
|
class DeleteCompanyFailure implements StopSaving {
|
||||||
DeleteCompanyFailure(this.error);
|
DeleteCompanyFailure(this.error);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ import 'package:invoiceninja_flutter/redux/group/group_reducer.dart';
|
||||||
UserCompanyState companyReducer(UserCompanyState state, dynamic action) {
|
UserCompanyState companyReducer(UserCompanyState state, dynamic action) {
|
||||||
if (action is RefreshData && action.loadCompanies) {
|
if (action is RefreshData && action.loadCompanies) {
|
||||||
return UserCompanyState();
|
return UserCompanyState();
|
||||||
|
} else if (action is DeleteCompanySuccess) {
|
||||||
|
return UserCompanyState();
|
||||||
}
|
}
|
||||||
|
|
||||||
return state.rebuild((b) => b
|
return state.rebuild((b) => b
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue