skip sending item update event for reading progress update

This commit is contained in:
Hongbo Wu
2024-01-04 15:06:31 +08:00
parent e67298980c
commit d31eb7a88b
2 changed files with 2 additions and 17 deletions

View File

@ -643,8 +643,7 @@ export const saveArticleReadingProgressResolver = authorized<
uid,
readingProgressPercent,
readingProgressTopPercent,
readingProgressAnchorIndex,
pubsub
readingProgressAnchorIndex
)
if (!updatedItem) {
return { errorCodes: [SaveArticleReadingProgressErrorCode.BadData] }

View File

@ -739,8 +739,7 @@ export const updateLibraryItemReadingProgress = async (
userId: string,
bottomPercent: number,
topPercent: number | null = null,
anchorIndex: number | null = null,
pubsub = createPubSubClient()
anchorIndex: number | null = null
): Promise<LibraryItem | null> => {
// If we have a top percent, we only save it if it's greater than the current top percent
// or set to zero if the top percent is zero.
@ -787,19 +786,6 @@ export const updateLibraryItemReadingProgress = async (
}
const updatedItem = result[0][0]
await pubsub.entityUpdated<QueryDeepPartialEntity<LibraryItem>>(
EntityType.PAGE,
{
id,
readingProgressBottomPercent: updatedItem.readingProgressBottomPercent,
readingProgressTopPercent: updatedItem.readingProgressTopPercent,
readingProgressHighestReadAnchor:
updatedItem.readingProgressHighestReadAnchor,
readAt: updatedItem.readAt,
},
userId
)
return updatedItem
}