don't load forwards if the array already exists in state
parent
c5e2a03a93
commit
3a7613e9ff
|
@ -15,8 +15,11 @@ export function loadServerSessions() {
|
|||
}
|
||||
|
||||
export function loadSessionForwards(sessionId) {
|
||||
return async function (dispatch) {
|
||||
return async function (dispatch, getState) {
|
||||
try {
|
||||
const forwards = getState().forwards[sessionId];
|
||||
if (forwards && (forwards.loading || forwards.loaded)) return;
|
||||
|
||||
dispatch({ type: types.LOAD_SESSION_FORWARDS_STARTED, id: sessionId });
|
||||
const data = await dispatch(
|
||||
sendHttpRequest(api.getSessionForwards(sessionId))
|
||||
|
|
Loading…
Reference in New Issue