mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Make sure cached reading progress is updated
This commit is contained in:
parent
67bf5003ea
commit
17e547b95e
2 changed files with 21 additions and 20 deletions
|
|
@ -161,6 +161,25 @@ export const GQL_SET_LABELS = gql`
|
|||
${labelFragment}
|
||||
`
|
||||
|
||||
export const GQL_SAVE_ARTICLE_READING_PROGRESS = gql`
|
||||
mutation SaveArticleReadingProgress(
|
||||
$input: SaveArticleReadingProgressInput!
|
||||
) {
|
||||
saveArticleReadingProgress(input: $input) {
|
||||
... on SaveArticleReadingProgressSuccess {
|
||||
updatedArticle {
|
||||
id
|
||||
readingProgressPercent
|
||||
readingProgressAnchorIndex
|
||||
}
|
||||
}
|
||||
... on SaveArticleReadingProgressError {
|
||||
errorCodes
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const GQL_UPDATE_LIBRARY_ITEM = gql`
|
||||
mutation UpdatePage($input: UpdatePageInput!) {
|
||||
updatePage(input: $input) {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import {
|
|||
GQL_DELETE_LIBRARY_ITEM,
|
||||
GQL_GET_LIBRARY_ITEM_CONTENT,
|
||||
GQL_MOVE_ITEM_TO_FOLDER,
|
||||
GQL_SAVE_ARTICLE_READING_PROGRESS,
|
||||
GQL_SEARCH_QUERY,
|
||||
GQL_SET_LABELS,
|
||||
GQL_SET_LINK_ARCHIVED,
|
||||
|
|
@ -300,7 +301,7 @@ export const useUpdateItemReadStatus = () => {
|
|||
queryClient.setQueryData(['libraryItems'], context.previousItems)
|
||||
}
|
||||
},
|
||||
onSettled: (data, error, variables, context) => {
|
||||
onSuccess: (data, variables, context) => {
|
||||
if (data) {
|
||||
updateItemPropertyInCache(
|
||||
queryClient,
|
||||
|
|
@ -497,25 +498,6 @@ export type ArticleReadingProgressMutationInput = {
|
|||
readingProgressAnchorIndex?: number
|
||||
}
|
||||
|
||||
const GQL_SAVE_ARTICLE_READING_PROGRESS = gql`
|
||||
mutation SaveArticleReadingProgress(
|
||||
$input: SaveArticleReadingProgressInput!
|
||||
) {
|
||||
saveArticleReadingProgress(input: $input) {
|
||||
... on SaveArticleReadingProgressSuccess {
|
||||
updatedArticle {
|
||||
id
|
||||
readingProgressPercent
|
||||
readingProgressAnchorIndex
|
||||
}
|
||||
}
|
||||
... on SaveArticleReadingProgressError {
|
||||
errorCodes
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export interface ReadableItem {
|
||||
id: string
|
||||
title: string
|
||||
|
|
|
|||
Loading…
Reference in a new issue