mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
Explore: Fix reset reducer duplication (#20838)
This commit is contained in:
parent
79c0fa4ca5
commit
6682a36b8a
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user