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

add null check on eventUsageLogic (#3125)

This commit is contained in:
Eric Duong 2021-02-01 00:30:37 -05:00 committed by GitHub
parent 34dbbec647
commit ff3d2d7aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import posthog from 'posthog-js'
import { userLogic } from 'scenes/userLogic'
import { eventUsageLogicType } from './eventUsageLogicType'
import { AnnotationType, FilterType, DashboardType } from '~/types'
import { ViewType } from 'scenes/insights/insightLogic'
const keyMappingKeys = Object.keys(keyMapping.event)
@ -143,7 +144,7 @@ export const eventUsageLogic = kea<eventUsageLogicType>({
}
for (const item of dashboard.items) {
const key = `${item.filters.insight.toLowerCase()}_count`
const key = `${item.filters?.insight?.toLowerCase() || ViewType.TRENDS}_count`
if (!properties[key]) {
properties[key] = 1
} else {