mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 16:45:43 -06:00
Explore: Fix reset reducer duplication (#20838)
This commit is contained in:
parent
79c0fa4ca5
commit
6682a36b8a
@ -55,7 +55,6 @@ import {
|
|||||||
updateUIStateAction,
|
updateUIStateAction,
|
||||||
toggleLogLevelAction,
|
toggleLogLevelAction,
|
||||||
changeLoadingStateAction,
|
changeLoadingStateAction,
|
||||||
resetExploreAction,
|
|
||||||
queryStreamUpdatedAction,
|
queryStreamUpdatedAction,
|
||||||
QueryEndedPayload,
|
QueryEndedPayload,
|
||||||
queryStoreSubscriptionAction,
|
queryStoreSubscriptionAction,
|
||||||
@ -727,6 +726,11 @@ export const exploreReducer = (state = initialExploreState, action: HigherOrderA
|
|||||||
}
|
}
|
||||||
|
|
||||||
case ActionTypes.ResetExplore: {
|
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)) {
|
if (action.payload.force || !Number.isInteger(state.left.originPanelId)) {
|
||||||
return initialExploreState;
|
return initialExploreState;
|
||||||
}
|
}
|
||||||
@ -758,19 +762,6 @@ export const exploreReducer = (state = initialExploreState, action: HigherOrderA
|
|||||||
[ExploreId.right]: updateChildRefreshState(rightState, action.payload, ExploreId.right),
|
[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) {
|
if (action.payload) {
|
||||||
|
Loading…
Reference in New Issue
Block a user