From 899fc9ecc4cd319ee4be39d163681c7caa395982 Mon Sep 17 00:00:00 2001 From: Marius Andra Date: Fri, 26 Jan 2024 16:31:08 +0100 Subject: [PATCH] fix(insights): query source editor works again --- frontend/src/scenes/insights/Insight.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/scenes/insights/Insight.tsx b/frontend/src/scenes/insights/Insight.tsx index c6c8698f93d45..0a548985695b6 100644 --- a/frontend/src/scenes/insights/Insight.tsx +++ b/frontend/src/scenes/insights/Insight.tsx @@ -1,5 +1,6 @@ import './Insight.scss' +import equal from 'fast-deep-equal' import { BindLogic, useActions, useMountedLogic, useValues } from 'kea' import { useEffect } from 'react' import { InsightPageHeader } from 'scenes/insights/InsightPageHeader' @@ -50,9 +51,9 @@ export function Insight({ insightId }: InsightSceneProps): JSX.Element { const actuallyShowQueryEditor = insightMode === ItemMode.Edit && showQueryEditor - const setQuery = (query: Node): void => { - if (!isInsightVizNode(query)) { - setInsightQuery(query) + const setQuery = (queryToSet: Node): void => { + if (!equal(query, queryToSet)) { + setInsightQuery(queryToSet) } }