fix(ui): sessions list pagination reset
This commit is contained in:
parent
383900ee37
commit
ef95bdeca5
2 changed files with 2 additions and 5 deletions
|
|
@ -58,6 +58,7 @@ interface Props extends RouteComponentProps {
|
||||||
checkForLatestSessions: () => void;
|
checkForLatestSessions: () => void;
|
||||||
toggleFavorite: (sessionId: string) => Promise<void>;
|
toggleFavorite: (sessionId: string) => Promise<void>;
|
||||||
sites: object[];
|
sites: object[];
|
||||||
|
isLoggedIn: boolean;
|
||||||
siteId: string;
|
siteId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,11 +71,7 @@ function reducer(state = initialState, action = {}) {
|
||||||
case EDIT:
|
case EDIT:
|
||||||
return state.mergeIn(['instance'], action.instance).set('currentPage', 1);
|
return state.mergeIn(['instance'], action.instance).set('currentPage', 1);
|
||||||
case APPLY:
|
case APPLY:
|
||||||
const _state = action.fromUrl ? state.set('instance', Filter(action.filter)) : state.mergeIn(['instance'], action.filter);
|
return action.fromUrl ? state.set('instance', Filter(action.filter)).set('currentPage', 1) : state.mergeIn(['instance'], action.filter).set('currentPage', 1);
|
||||||
if (action.resetPage) {
|
|
||||||
_state.set('currentPage', 1)
|
|
||||||
}
|
|
||||||
return _state
|
|
||||||
case success(FETCH):
|
case success(FETCH):
|
||||||
return state.set('instance', action.data);
|
return state.set('instance', action.data);
|
||||||
case success(FETCH_LIST):
|
case success(FETCH_LIST):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue