Skip to content

Commit

Permalink
Use cache to query chapters with state
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
schroda committed Apr 23, 2024
1 parent 23e639a commit 0c4ce2c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/lib/requests/RequestManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 0c4ce2c

Please sign in to comment.