Skip to content

Commit

Permalink
send page_update event if mark as unread
Browse files Browse the repository at this point in the history
  • Loading branch information
sywhb committed Aug 29, 2024
1 parent 0f2eeef commit 89c254d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/api/src/services/library_item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1039,8 +1039,9 @@ export const updateLibraryItemReadingProgress = async (
}

const updatedItem = result[0][0]
if (updatedItem.readingProgressBottomPercent === 100) {
// mark item as read
const readingProgress = updatedItem.readingProgressBottomPercent
if (readingProgress === 0 || readingProgress === 100) {
// only send PAGE_UPDATED event if users mark item as read or unread
await pubsub.entityUpdated<ItemEvent>(EntityType.ITEM, updatedItem, userId)
}

Expand Down

0 comments on commit 89c254d

Please sign in to comment.