Adds client event for empty feed error (#9287)
* Adds client event for empty feed error * Only log for discover --------- Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -196,6 +196,10 @@ export type MetricEvents = {
|
|||||||
count: number
|
count: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
'feed:discover:emptyError': {
|
||||||
|
userDid: string
|
||||||
|
}
|
||||||
|
|
||||||
'composer:gif:open': {}
|
'composer:gif:open': {}
|
||||||
'composer:gif:select': {}
|
'composer:gif:select': {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React from 'react'
|
import React, {useEffect} from 'react'
|
||||||
import {StyleSheet, View} from 'react-native'
|
import {StyleSheet, View} from 'react-native'
|
||||||
import {
|
import {
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon,
|
||||||
@@ -7,15 +7,38 @@ import {
|
|||||||
import {Trans} from '@lingui/macro'
|
import {Trans} from '@lingui/macro'
|
||||||
import {useNavigation} from '@react-navigation/native'
|
import {useNavigation} from '@react-navigation/native'
|
||||||
|
|
||||||
|
import {DISCOVER_FEED_URI} from '#/lib/constants'
|
||||||
import {usePalette} from '#/lib/hooks/usePalette'
|
import {usePalette} from '#/lib/hooks/usePalette'
|
||||||
import {MagnifyingGlassIcon} from '#/lib/icons'
|
import {MagnifyingGlassIcon} from '#/lib/icons'
|
||||||
import {type NavigationProp} from '#/lib/routes/types'
|
import {type NavigationProp} from '#/lib/routes/types'
|
||||||
import {s} from '#/lib/styles'
|
import {s} from '#/lib/styles'
|
||||||
|
import {logger} from '#/logger'
|
||||||
import {isWeb} from '#/platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
|
import {useFeedFeedbackContext} from '#/state/feed-feedback'
|
||||||
|
import {useSession} from '#/state/session'
|
||||||
import {Button} from '../util/forms/Button'
|
import {Button} from '../util/forms/Button'
|
||||||
import {Text} from '../util/text/Text'
|
import {Text} from '../util/text/Text'
|
||||||
|
|
||||||
export function CustomFeedEmptyState() {
|
export function CustomFeedEmptyState() {
|
||||||
|
const feedFeedback = useFeedFeedbackContext()
|
||||||
|
const {currentAccount} = useSession()
|
||||||
|
const hasLoggedDiscoverEmptyErrorRef = React.useRef(false)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// Log the empty feed error event
|
||||||
|
if (feedFeedback.feedSourceInfo && currentAccount?.did) {
|
||||||
|
const uri = feedFeedback.feedSourceInfo.uri
|
||||||
|
if (
|
||||||
|
uri === DISCOVER_FEED_URI &&
|
||||||
|
!hasLoggedDiscoverEmptyErrorRef.current
|
||||||
|
) {
|
||||||
|
hasLoggedDiscoverEmptyErrorRef.current = true
|
||||||
|
logger.metric('feed:discover:emptyError', {
|
||||||
|
userDid: currentAccount.did,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [feedFeedback.feedSourceInfo, currentAccount?.did])
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const palInverted = usePalette('inverted')
|
const palInverted = usePalette('inverted')
|
||||||
const navigation = useNavigation<NavigationProp>()
|
const navigation = useNavigation<NavigationProp>()
|
||||||
|
|||||||
Reference in New Issue
Block a user