Commit 6682a36b by Andrej Ocenas Committed by GitHub

Explore: Fix reset reducer duplication (#20838)

parent 79c0fa4c
......@@ -55,7 +55,6 @@ import {
updateUIStateAction,
toggleLogLevelAction,
changeLoadingStateAction,
resetExploreAction,
queryStreamUpdatedAction,
QueryEndedPayload,
queryStoreSubscriptionAction,
......@@ -727,6 +726,11 @@ export const exploreReducer = (state = initialExploreState, action: HigherOrderA
}
case ActionTypes.ResetExplore: {
const leftState = state[ExploreId.left];
const rightState = state[ExploreId.right];
stopQueryState(leftState.querySubscription);
stopQueryState(rightState.querySubscription);
if (action.payload.force || !Number.isInteger(state.left.originPanelId)) {
return initialExploreState;
}
......@@ -758,19 +762,6 @@ export const exploreReducer = (state = initialExploreState, action: HigherOrderA
[ExploreId.right]: updateChildRefreshState(rightState, action.payload, ExploreId.right),
};
}
case resetExploreAction.type: {
const leftState = state[ExploreId.left];
const rightState = state[ExploreId.right];
stopQueryState(leftState.querySubscription);
stopQueryState(rightState.querySubscription);
return {
...state,
[ExploreId.left]: updateChildRefreshState(leftState, action.payload, ExploreId.left),
[ExploreId.right]: updateChildRefreshState(rightState, action.payload, ExploreId.right),
};
}
}
if (action.payload) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment