mirror of
https://dev.azure.com/tstanciu94/ReverseProxy/_git/ReverseProxy_Frontend
synced 2022-12-28 18:12:07 +02:00
don't load forwards if the array already exists in state
This commit is contained in:
parent
c5e2a03a93
commit
3a7613e9ff
@ -15,8 +15,11 @@ export function loadServerSessions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function loadSessionForwards(sessionId) {
|
export function loadSessionForwards(sessionId) {
|
||||||
return async function (dispatch) {
|
return async function (dispatch, getState) {
|
||||||
try {
|
try {
|
||||||
|
const forwards = getState().forwards[sessionId];
|
||||||
|
if (forwards && (forwards.loading || forwards.loaded)) return;
|
||||||
|
|
||||||
dispatch({ type: types.LOAD_SESSION_FORWARDS_STARTED, id: sessionId });
|
dispatch({ type: types.LOAD_SESSION_FORWARDS_STARTED, id: sessionId });
|
||||||
const data = await dispatch(
|
const data = await dispatch(
|
||||||
sendHttpRequest(api.getSessionForwards(sessionId))
|
sendHttpRequest(api.getSessionForwards(sessionId))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user