fix(ui) - session list refresh

This commit is contained in:
Shekar Siri 2022-07-21 11:55:44 +02:00
parent 57b813b372
commit 8897207baa
3 changed files with 6 additions and 6 deletions

View file

@ -10,7 +10,7 @@ import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG';
// const ALL = 'all';
const PER_PAGE = 10;
const AUTOREFRESH_INTERVAL = 3 * 60 * 1000;
const AUTOREFRESH_INTERVAL = 2 * 60 * 1000;
var timeoutId;
@connect(state => ({

View file

@ -150,6 +150,7 @@ export const reduceThenFetchResource =
filter.filters = filter.filters.map(filterMap);
filter.limit = 10;
filter.page = getState().getIn(['search', 'currentPage']);
const forceFetch = filter.filters.length === 0;
// duration filter from local storage
if (!filter.filters.find((f) => f.type === FilterKey.DURATION)) {
@ -172,7 +173,7 @@ export const reduceThenFetchResource =
}
}
return isRoute(ERRORS_ROUTE, window.location.pathname) ? dispatch(fetchErrorsList(filter)) : dispatch(fetchSessionList(filter));
return isRoute(ERRORS_ROUTE, window.location.pathname) ? dispatch(fetchErrorsList(filter)) : dispatch(fetchSessionList(filter, forceFetch));
};
export const edit = reduceThenFetchResource((instance) => ({

View file

@ -67,8 +67,8 @@ const reducer = (state = initialState, action = {}) => {
switch (action.type) {
case INIT:
return state.set('current', Session(action.session));
case FETCH_LIST.REQUEST:
return action.clear ? state.set('list', List()) : state;
// case FETCH_LIST.REQUEST:
// return action.clear ? state.set('list', List()) : state;
case FETCH_ERROR_STACK.SUCCESS:
return state.set('errorStack', List(action.data.trace).map(ErrorStack)).set('sourcemapUploaded', action.data.sourcemapUploaded);
case FETCH_LIVE_LIST.SUCCESS:
@ -224,7 +224,7 @@ function init(session) {
}
export const fetchList =
(params = {}, clear = false, force = false) =>
(params = {}, force = false) =>
(dispatch, getState) => {
if (!force) { // compare with the last fetched filter
const oldFilters = getSessionFilter();
@ -237,7 +237,6 @@ export const fetchList =
return dispatch({
types: FETCH_LIST.toArray(),
call: (client) => client.post('/sessions/search2', params),
clear,
params: cleanParams(params),
});
};