diff --git a/public/app/features/explore/ExplorePaneContainer.tsx b/public/app/features/explore/ExplorePaneContainer.tsx index fe55a4cb3b8..1470ff0e4df 100644 --- a/public/app/features/explore/ExplorePaneContainer.tsx +++ b/public/app/features/explore/ExplorePaneContainer.tsx @@ -63,8 +63,14 @@ export class ExplorePaneContainerUnconnected extends React.PureComponent { - const { exploreId, urlQuery } = this.props; + const { exploreId, urlQuery, path } = this.props; + + // Make sure we don't refresh after navigating outside as this would be called before parent unmounts + if (!path.match(/\/explore$/)) { + return; + } // Update state from url only if it changed and only if the change wasn't initialised by redux to prevent any loops if (urlQuery !== prevUrlQuery && urlQuery !== lastSavedUrl[exploreId]) { @@ -99,6 +110,7 @@ const getTimeRangeFromUrlMemoized = memoizeOne(getTimeRangeFromUrl); function mapStateToProps(state: StoreState, { exploreId }: { exploreId: ExploreId }) { const urlQuery = state.location.query[exploreId] as string; + const path = state.location.path; const urlState = parseUrlState(urlQuery); const timeZone = getTimeZone(state.user); @@ -116,6 +128,7 @@ function mapStateToProps(state: StoreState, { exploreId }: { exploreId: ExploreI initialRange, originPanelId, urlQuery, + path, }; }