Clear AP history when purging data
This commit is contained in:
parent
2def694c7d
commit
0fdd21fa86
|
|
@ -441,13 +441,14 @@ Middleware<AppState> _purgeData(AuthRepository repository) {
|
||||||
NextDispatcher next) async {
|
NextDispatcher next) async {
|
||||||
final action = dynamicAction as PurgeDataRequest;
|
final action = dynamicAction as PurgeDataRequest;
|
||||||
final state = store.state;
|
final state = store.state;
|
||||||
|
final company = state.company;
|
||||||
|
|
||||||
repository
|
repository
|
||||||
.purgeData(
|
.purgeData(
|
||||||
credentials: state.credentials,
|
credentials: state.credentials,
|
||||||
password: action.password,
|
password: action.password,
|
||||||
idToken: action.idToken,
|
idToken: action.idToken,
|
||||||
companyId: state.company.id)
|
companyId: company.id)
|
||||||
.then((dynamic value) {
|
.then((dynamic value) {
|
||||||
store.dispatch(PurgeDataSuccess());
|
store.dispatch(PurgeDataSuccess());
|
||||||
store.dispatch(RefreshData(
|
store.dispatch(RefreshData(
|
||||||
|
|
|
||||||
|
|
@ -435,6 +435,10 @@ CompanyPrefState companyPrefReducer(CompanyPrefState state, dynamic action) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Reducer<BuiltList<HistoryRecord>> historyReducer = combineReducers([
|
Reducer<BuiltList<HistoryRecord>> historyReducer = combineReducers([
|
||||||
|
TypedReducer<BuiltList<HistoryRecord>, PurgeDataSuccess>(
|
||||||
|
(historyList, action) {
|
||||||
|
return BuiltList<HistoryRecord>();
|
||||||
|
}),
|
||||||
TypedReducer<BuiltList<HistoryRecord>, PopLastHistory>(
|
TypedReducer<BuiltList<HistoryRecord>, PopLastHistory>(
|
||||||
(historyList, action) {
|
(historyList, action) {
|
||||||
if (historyList.isEmpty) {
|
if (historyList.isEmpty) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue