From 14a558fce764e547eb5c82cda6e8d16dc3d027e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Obermu=CC=88ller?= Date: Thu, 2 Nov 2023 12:34:58 +0100 Subject: [PATCH] update the query cache on mount --- .../src/scenes/insights/InsightNav/insightNavLogic.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/scenes/insights/InsightNav/insightNavLogic.tsx b/frontend/src/scenes/insights/InsightNav/insightNavLogic.tsx index c2b3cd32cdb0b..b07540564eade 100644 --- a/frontend/src/scenes/insights/InsightNav/insightNavLogic.tsx +++ b/frontend/src/scenes/insights/InsightNav/insightNavLogic.tsx @@ -1,4 +1,4 @@ -import { actions, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea' +import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea' import { InsightLogicProps, InsightType, ActionFilter } from '~/types' import type { insightNavLogicType } from './insightNavLogicType' @@ -240,6 +240,11 @@ export const insightNavLogic = kea([ } }, })), + afterMount(({ values, actions }) => { + if (values.query && isInsightVizNode(values.query)) { + actions.updateQueryPropertyCache(cachePropertiesFromQuery(values.query.source, values.queryPropertyCache)) + } + }), ]) const cachePropertiesFromQuery = (query: InsightQueryNode, cache: QueryPropertyCache | null): QueryPropertyCache => {