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,
|
||||
companyId: state.company.id)
|
||||
.then((dynamic value) {
|
||||
action.completer.complete(null);
|
||||
store.dispatch(DeleteCompanySuccess());
|
||||
action.completer.complete(null);
|
||||
}).catchError((Object error) {
|
||||
store.dispatch(DeleteCompanyFailure(error));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -54,9 +54,7 @@ class DeleteCompanyRequest implements StartSaving {
|
|||
final String password;
|
||||
}
|
||||
|
||||
class DeleteCompanySuccess implements StopSaving, PersistData {
|
||||
DeleteCompanySuccess();
|
||||
}
|
||||
class DeleteCompanySuccess implements StopSaving, PersistData {}
|
||||
|
||||
class DeleteCompanyFailure implements StopSaving {
|
||||
DeleteCompanyFailure(this.error);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ import 'package:invoiceninja_flutter/redux/group/group_reducer.dart';
|
|||
UserCompanyState companyReducer(UserCompanyState state, dynamic action) {
|
||||
if (action is RefreshData && action.loadCompanies) {
|
||||
return UserCompanyState();
|
||||
} else if (action is DeleteCompanySuccess) {
|
||||
return UserCompanyState();
|
||||
}
|
||||
|
||||
return state.rebuild((b) => b
|
||||
|
|
|
|||
Loading…
Reference in New Issue