Skip to content

Commit 89c254d

Browse files
committed
send page_update event if mark as unread
1 parent 0f2eeef commit 89c254d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/api/src/services/library_item.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,8 +1039,9 @@ export const updateLibraryItemReadingProgress = async (
10391039
}
10401040

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

0 commit comments

Comments
 (0)