Skip to content

Commit

Permalink
fix(dashboards): fix loading issues (#19812)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra authored Jan 17, 2024
1 parent 1e42154 commit e5f3813
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions frontend/src/queries/nodes/DataNode/dataNodeLogic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import clsx from 'clsx'
import equal from 'fast-deep-equal'
import {
actions,
afterMount,
Expand All @@ -16,7 +15,7 @@ import {
} from 'kea'
import { loaders } from 'kea-loaders'
import { subscriptions } from 'kea-subscriptions'
import api, { ApiMethodOptions, getJSONOrThrow } from 'lib/api'
import api, { ApiMethodOptions } from 'lib/api'
import { FEATURE_FLAGS } from 'lib/constants'
import { dayjs } from 'lib/dayjs'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
Expand All @@ -41,18 +40,8 @@ import {
QueryResponse,
QueryTiming,
} from '~/queries/schema'
import {
isActorsQuery,
isEventsQuery,
isInsightActorsQuery,
isInsightQueryNode,
isLifecycleQuery,
isPersonsNode,
isStickinessQuery,
isTrendsQuery,
} from '~/queries/utils'
import { isActorsQuery, isEventsQuery, isInsightActorsQuery, isInsightQueryNode, isPersonsNode } from '~/queries/utils'

import { filtersToQueryNode } from '../InsightQuery/utils/filtersToQueryNode'
import type { dataNodeLogicType } from './dataNodeLogicType'

export interface DataNodeLogicProps {
Expand Down Expand Up @@ -123,22 +112,6 @@ export const dataNodeLogic = kea<dataNodeLogicType>([
if (props.doNotLoad) {
return props.cachedResults
}
if (
isInsightQueryNode(props.query) &&
!(values.hogQLInsightsLifecycleFlagEnabled && isLifecycleQuery(props.query)) &&
!(values.hogQLInsightsTrendsFlagEnabled && isTrendsQuery(props.query)) &&
!(values.hogQLInsightsStickinessFlagEnabled && isStickinessQuery(props.query)) &&
props.cachedResults &&
props.cachedResults['id'] &&
props.cachedResults['filters'] &&
equal(props.query, filtersToQueryNode(props.cachedResults['filters']))
) {
const url = `api/projects/${values.currentTeamId}/insights/${props.cachedResults['id']}?refresh=true`
const fetchResponse = await api.getResponse(url)
const data = await getJSONOrThrow(fetchResponse)
breakpoint()
return data
}

if (props.cachedResults && !refresh) {
if (
Expand Down

0 comments on commit e5f3813

Please sign in to comment.