mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: correctly cleanup state on unmount (#32557)
This commit is contained in:
parent
8e70d5d181
commit
0c2c52c627
@ -184,6 +184,14 @@ export const exploreReducer = (state = initialExploreState, action: AnyAction):
|
|||||||
|
|
||||||
if (cleanupPaneAction.match(action)) {
|
if (cleanupPaneAction.match(action)) {
|
||||||
const { exploreId } = action.payload as CleanupPanePayload;
|
const { exploreId } = action.payload as CleanupPanePayload;
|
||||||
|
|
||||||
|
// We want to do this only when we remove single pane not when we are unmounting whole explore.
|
||||||
|
// It needs to be checked like this because in component we don't get new path (which would tell us if we are
|
||||||
|
// navigating out of explore) before the unmount.
|
||||||
|
if (!state[exploreId]?.initialized) {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
if (exploreId === ExploreId.left) {
|
if (exploreId === ExploreId.left) {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
|
Loading…
Reference in New Issue
Block a user