Check Analytics (#2106)

* fix sign in event tracking

* add missing analytics events

* add more missing analytics

* fix like and unrepost event tracking

* reset onEndReachedThreshold
This commit is contained in:
Ansh 2023-12-06 11:45:01 -06:00 committed by GitHub
parent 7229cda5a5
commit 8e541d753a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 41 additions and 22 deletions

View file

@ -571,7 +571,7 @@ function AboutSection({
const scrollHandler = useAnimatedScrollHandler(onScroll)
const [likeUri, setLikeUri] = React.useState(feedInfo.likeUri)
const {hasSession} = useSession()
const {track} = useAnalytics()
const {mutateAsync: likeFeed, isPending: isLikePending} = useLikeMutation()
const {mutateAsync: unlikeFeed, isPending: isUnlikePending} =
useUnlikeMutation()
@ -586,9 +586,11 @@ function AboutSection({
if (isLiked && likeUri) {
await unlikeFeed({uri: likeUri})
track('CustomFeed:Unlike')
setLikeUri('')
} else {
const res = await likeFeed({uri: feedInfo.uri, cid: feedInfo.cid})
track('CustomFeed:Like')
setLikeUri(res.uri)
}
} catch (err) {
@ -597,7 +599,7 @@ function AboutSection({
)
logger.error('Failed up toggle like', {error: err})
}
}, [likeUri, isLiked, feedInfo, likeFeed, unlikeFeed])
}, [likeUri, isLiked, feedInfo, likeFeed, unlikeFeed, track])
return (
<ScrollView