From 89c254d56afbf362307fe7090f494542f5168022 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Thu, 29 Aug 2024 12:48:55 +0800 Subject: [PATCH] send page_update event if mark as unread --- packages/api/src/services/library_item.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/api/src/services/library_item.ts b/packages/api/src/services/library_item.ts index 6e26a0966a..f4cc5457ba 100644 --- a/packages/api/src/services/library_item.ts +++ b/packages/api/src/services/library_item.ts @@ -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(EntityType.ITEM, updatedItem, userId) }