0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00

Fixes lifecycle & stickiness selecting action/events (#4249)

This commit is contained in:
Paolo D'Amico 2021-05-06 19:06:40 -07:00 committed by GitHub
parent c4f8abbdfc
commit 3dac5f5157
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -20,6 +20,8 @@ export enum ViewType {
PATHS = 'PATHS',
}
export const TRENDS_BASED_INSIGHTS = ['TRENDS', 'STICKINESS', 'LIFECYCLE'] // Insights that are based on the same `Trends` components
/*
InsightLogic maintains state for changing between insight features
This includes handling the urls and view state

View File

@ -14,7 +14,7 @@ import {
ACTION_TYPE,
ShownAsValue,
} from 'lib/constants'
import { ViewType, insightLogic, defaultFilterTestAccounts } from '../insights/insightLogic'
import { ViewType, insightLogic, defaultFilterTestAccounts, TRENDS_BASED_INSIGHTS } from '../insights/insightLogic'
import { insightHistoryLogic } from '../insights/InsightHistoryPanel/insightHistoryLogic'
import { SESSIONS_WITH_RECORDINGS_FILTER } from 'scenes/sessions/filters/constants'
import { ActionFilter, ActionType, FilterType, PersonType, PropertyFilter, TrendResult, EntityTypes } from '~/types'
@ -234,7 +234,7 @@ export const trendsLogic = kea<
>,
{
setFilters: (state, { filters, mergeFilters }) => {
const newState = state?.insight === ViewType.TRENDS ? state : {}
const newState = state?.insight && TRENDS_BASED_INSIGHTS.includes(state.insight) ? state : {}
return cleanFilters({
...(mergeFilters ? newState : {}),
...filters,