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 5b7d1bb commit 43fb698
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 43fb698

Please sign in to comment.