Skip to content

Commit

Permalink
Fix view count calc
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh-mn-yral committed Nov 28, 2023
1 parent efd82b0 commit f36b4d4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ export async function viewPost(
const { totalCount, partialWatchedPercentage } = watchProgress
if (totalCount === 0 && partialWatchedPercentage === 0) return

updatePostInWatchHistory('up-down-watch-history', post)
const viewCount = (totalCount || 0) + (partialWatchedPercentage || 0) / 100

const watchCount = (totalCount || 0) + (partialWatchedPercentage || 0)
if (!viewCount) return

if (!watchCount) return
updatePostInWatchHistory('up-down-watch-history', post)

await viewVideo(
{
Expand All @@ -110,7 +110,7 @@ export async function viewPost(
videoUoid: post.ouid,
videoUid: post.video_uid,
},
watchCount,
viewCount,
)

const authStateData = get(authState)
Expand Down

0 comments on commit f36b4d4

Please sign in to comment.