diff --git a/lib/redux/auth/auth_middleware.dart b/lib/redux/auth/auth_middleware.dart index 55ee02740..f2bbfc808 100644 --- a/lib/redux/auth/auth_middleware.dart +++ b/lib/redux/auth/auth_middleware.dart @@ -441,13 +441,14 @@ Middleware _purgeData(AuthRepository repository) { NextDispatcher next) async { final action = dynamicAction as PurgeDataRequest; final state = store.state; + final company = state.company; repository .purgeData( credentials: state.credentials, password: action.password, idToken: action.idToken, - companyId: state.company.id) + companyId: company.id) .then((dynamic value) { store.dispatch(PurgeDataSuccess()); store.dispatch(RefreshData( diff --git a/lib/redux/ui/pref_reducer.dart b/lib/redux/ui/pref_reducer.dart index 88af7e1b4..1b07ed9b7 100644 --- a/lib/redux/ui/pref_reducer.dart +++ b/lib/redux/ui/pref_reducer.dart @@ -435,6 +435,10 @@ CompanyPrefState companyPrefReducer(CompanyPrefState state, dynamic action) { } Reducer> historyReducer = combineReducers([ + TypedReducer, PurgeDataSuccess>( + (historyList, action) { + return BuiltList(); + }), TypedReducer, PopLastHistory>( (historyList, action) { if (historyList.isEmpty) {