Use cache to query chapters with state

There is a potential that the cached chapters state is outdated, but this is a marginal issue and is preferred over sending a request to the server everytime for data that is most likely already known.
The triggered downloads will also reflect what is currently shown in the UI, so it will most likely never be known if some chapter state was outdated.
This commit is contained in:
schroda
2024-04-23 13:50:49 +02:00
parent 23e639a4e9
commit 0c4ce2c9c5

View File

@@ -1768,15 +1768,7 @@ export class RequestManager {
states: Pick<ChapterConditionInput, 'isRead' | 'isDownloaded' | 'isBookmarked'>,
options?: QueryOptions<GetMangasChapterIdsWithStateQueryVariables, GetMangasChapterIdsWithStateQuery>,
): AbortabaleApolloQueryResponse<GetMangasChapterIdsWithStateQuery> {
return this.doRequest(
GQLMethod.QUERY,
GET_MANGAS_CHAPTER_IDS_WITH_STATE,
{ mangaIds, ...states },
{
fetchPolicy: 'no-cache',
...options,
},
);
return this.doRequest(GQLMethod.QUERY, GET_MANGAS_CHAPTER_IDS_WITH_STATE, { mangaIds, ...states }, options);
}
public getMangaChaptersFetch(