Merge pull request #248 from omnivore-app/fix/elastic-reading-progress-nulls

Remove function handlers for reading progress
This commit is contained in:
Jackson Harper 2022-03-16 13:18:29 -07:00 committed by GitHub
commit bef3dbd23a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -386,36 +386,6 @@ export const functionResolvers = {
? ContentReader.Pdf
: ContentReader.Web
},
async readingProgressPercent(
article: { id: string; readingProgressPercent?: number },
_: unknown,
ctx: WithDataSourcesContext & { claims: Claims }
) {
if ('readingProgressPercent' in article) {
return article.readingProgressPercent
}
return (
await getPageByParam({
userId: ctx.claims.uid,
_id: article.id,
})
)?.readingProgressPercent
},
async readingProgressAnchorIndex(
article: { id: string; readingProgressAnchorIndex?: number },
_: unknown,
ctx: WithDataSourcesContext & { claims: Claims }
) {
if ('readingProgressAnchorIndex' in article) {
return article.readingProgressAnchorIndex
}
return (
await getPageByParam({
userId: ctx.claims.uid,
_id: article.id,
})
)?.readingProgressAnchorIndex
},
async highlights(
article: { id: string; userId?: string },
_: { input: ArticleHighlightsInput },