fix reading progress not updated after reading by updating cache (#258)

This commit is contained in:
Hongbo Wu
2022-03-18 09:58:08 +08:00
committed by GitHub
parent 7910565dbf
commit 7650a12be3
2 changed files with 6 additions and 1 deletions

View File

@ -207,6 +207,9 @@ export function HomeFeedContainer(props: HomeFeedContainerProps): JSX.Element {
scrollToActiveCard(activeCardId)
alreadyScrolled.current = true
}
if (activeItem) {
performActionOnItem('refresh', activeItem)
}
}, [activeCardId, scrollToActiveCard])
const handleCardAction = async (

View File

@ -6,7 +6,6 @@ import { articleFragment } from '../fragments/articleFragment'
import { setLinkArchivedMutation } from '../mutations/setLinkArchivedMutation'
import { deleteLinkMutation } from '../mutations/deleteLinkMutation'
import { articleReadingProgressMutation } from '../mutations/articleReadingProgressMutation'
import { labelFragment } from '../fragments/labelFragment'
import { Label } from './useGetLabelsQuery'
export type LibraryItemsQueryInput = {
@ -34,6 +33,7 @@ type LibraryItemAction =
| 'delete'
| 'mark-read'
| 'mark-unread'
| 'refresh'
export type LibraryItemsData = {
articles: LibraryItems
@ -259,6 +259,8 @@ export function useGetLibraryItemsQuery({
readingProgressAnchorIndex: 0,
})
break
case 'refresh':
await mutate()
}
}