diff options
author | Paul Frazee <pfrazee@gmail.com> | 2024-11-23 16:20:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-23 16:20:24 -0800 |
commit | 32bf8122e8c8a0fbadd53b8a015cfbc9014519a2 (patch) | |
tree | 55bd24596e6fadadbf4326b26e3d14e418c5c7bb /src/state/queries/post.ts | |
parent | 523d1f01a51c0e85e49916fb42b204f7004ffac1 (diff) | |
parent | b4d07c4112b9a62b5380948051aa4a7fd391a2d4 (diff) | |
download | voidsky-32bf8122e8c8a0fbadd53b8a015cfbc9014519a2.tar.zst |
Merge branch 'main' into main
Diffstat (limited to 'src/state/queries/post.ts')
-rw-r--r-- | src/state/queries/post.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/state/queries/post.ts b/src/state/queries/post.ts index 7023580bb..7052590ca 100644 --- a/src/state/queries/post.ts +++ b/src/state/queries/post.ts @@ -98,8 +98,8 @@ export function useGetPosts() { export function usePostLikeMutationQueue( post: Shadow<AppBskyFeedDefs.PostView>, - logContext: LogEvents['post:like:sampled']['logContext'] & - LogEvents['post:unlike:sampled']['logContext'], + logContext: LogEvents['post:like']['logContext'] & + LogEvents['post:unlike']['logContext'], ) { const queryClient = useQueryClient() const postUri = post.uri @@ -157,7 +157,7 @@ export function usePostLikeMutationQueue( } function usePostLikeMutation( - logContext: LogEvents['post:like:sampled']['logContext'], + logContext: LogEvents['post:like']['logContext'], post: Shadow<AppBskyFeedDefs.PostView>, ) { const {currentAccount} = useSession() @@ -174,7 +174,7 @@ function usePostLikeMutation( if (currentAccount) { ownProfile = findProfileQueryData(queryClient, currentAccount.did) } - logEvent('post:like:sampled', { + logEvent('post:like', { logContext, doesPosterFollowLiker: postAuthor.viewer ? Boolean(postAuthor.viewer.followedBy) @@ -196,12 +196,12 @@ function usePostLikeMutation( } function usePostUnlikeMutation( - logContext: LogEvents['post:unlike:sampled']['logContext'], + logContext: LogEvents['post:unlike']['logContext'], ) { const agent = useAgent() return useMutation<void, Error, {postUri: string; likeUri: string}>({ mutationFn: ({likeUri}) => { - logEvent('post:unlike:sampled', {logContext}) + logEvent('post:unlike', {logContext}) return agent.deleteLike(likeUri) }, }) @@ -209,8 +209,8 @@ function usePostUnlikeMutation( export function usePostRepostMutationQueue( post: Shadow<AppBskyFeedDefs.PostView>, - logContext: LogEvents['post:repost:sampled']['logContext'] & - LogEvents['post:unrepost:sampled']['logContext'], + logContext: LogEvents['post:repost']['logContext'] & + LogEvents['post:unrepost']['logContext'], ) { const queryClient = useQueryClient() const postUri = post.uri @@ -266,7 +266,7 @@ export function usePostRepostMutationQueue( } function usePostRepostMutation( - logContext: LogEvents['post:repost:sampled']['logContext'], + logContext: LogEvents['post:repost']['logContext'], ) { const agent = useAgent() return useMutation< @@ -275,19 +275,19 @@ function usePostRepostMutation( {uri: string; cid: string} // the post's uri and cid >({ mutationFn: post => { - logEvent('post:repost:sampled', {logContext}) + logEvent('post:repost', {logContext}) return agent.repost(post.uri, post.cid) }, }) } function usePostUnrepostMutation( - logContext: LogEvents['post:unrepost:sampled']['logContext'], + logContext: LogEvents['post:unrepost']['logContext'], ) { const agent = useAgent() return useMutation<void, Error, {postUri: string; repostUri: string}>({ mutationFn: ({repostUri}) => { - logEvent('post:unrepost:sampled', {logContext}) + logEvent('post:unrepost', {logContext}) return agent.deleteRepost(repostUri) }, }) |