diff --git a/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts b/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts index fddc17d2a2df2..6dc4212688572 100644 --- a/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts +++ b/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts @@ -127,14 +127,17 @@ export const dataNodeLogic = kea([ actions.clearResponse() } if ( - !(props.cachedResults && props.key.includes('dashboard')) && // Don't load data on dashboard if cached results are available + !( + (props.cachedResults?.['result'] || props.cachedResults?.['results']) && + props.key.includes('dashboard') + ) && // Don't load data on dashboard if cached results are available ((!values.response?.['result'] && !values.response?.['results']) || !queryEqual(props.query, oldProps.query)) && (!props.cachedResults || (isInsightQueryNode(props.query) && !props.cachedResults['result'] && !props.cachedResults['results'])) ) { actions.loadData() - } else if (props.cachedResults) { + } else if (props.cachedResults && !values.response?.['result'] && !values.response?.['results']) { // Use cached results if available, otherwise this logic will load the data again actions.setResponse(props.cachedResults) } diff --git a/frontend/src/scenes/dashboard/dashboardLogic.test.ts b/frontend/src/scenes/dashboard/dashboardLogic.test.ts index 9140af67da6a7..665c405663f3f 100644 --- a/frontend/src/scenes/dashboard/dashboardLogic.test.ts +++ b/frontend/src/scenes/dashboard/dashboardLogic.test.ts @@ -459,7 +459,7 @@ describe('dashboardLogic', () => { }) .toFinishAllListeners() .toMatchValues({ - refreshStatus: { 1001: { error: true, timer: expect.anything() } }, + refreshStatus: { 1001: { refreshed: true, timer: expect.anything() } }, }) }) }) diff --git a/frontend/src/scenes/dashboard/dashboardLogic.tsx b/frontend/src/scenes/dashboard/dashboardLogic.tsx index b280e1a422f2e..0545b44f69427 100644 --- a/frontend/src/scenes/dashboard/dashboardLogic.tsx +++ b/frontend/src/scenes/dashboard/dashboardLogic.tsx @@ -1010,7 +1010,7 @@ export const dashboardLogic = kea([ } cancelled = true } else { - actions.setRefreshError(insight.short_id) + actions.setRefreshStatus(insight.short_id) } }