Fix typing after "apollo-client" update to v3.13.1
Introduced due to the apollo-client dependency update in f39c902b5f
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { t as translate } from 'i18next';
|
import { t as translate } from 'i18next';
|
||||||
import gql from 'graphql-tag';
|
|
||||||
import { DocumentNode, MaybeMasked, Unmasked, useFragment } from '@apollo/client';
|
import { DocumentNode, MaybeMasked, Unmasked, useFragment } from '@apollo/client';
|
||||||
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
import { makeToast } from '@/modules/core/utils/Toast.ts';
|
||||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||||
@@ -168,23 +167,10 @@ export class Chapters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static isDownloading(id: number): boolean {
|
static isDownloading(id: number): boolean {
|
||||||
return !!requestManager.graphQLClient.client.cache.readFragment<ChapterType>({
|
const activeDownloadStates = [DownloadState.Downloading, DownloadState.Queued];
|
||||||
id: requestManager.graphQLClient.client.cache.identify({
|
const downloadStatus = Chapters.getDownloadStatusFromCache(id);
|
||||||
__typename: 'DownloadType',
|
|
||||||
chapter: {
|
return activeDownloadStates.includes(downloadStatus?.state as DownloadState);
|
||||||
__ref: requestManager.graphQLClient.client.cache.identify({
|
|
||||||
__typename: 'ChapterType',
|
|
||||||
id,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
fragment: gql`
|
|
||||||
fragment CHAPTER_DOWNLOAD_QUEUE_CHECK on ChapterType {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
fragmentName: 'CHAPTER_DOWNLOAD_QUEUE_CHECK',
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static isDownloaded({ isDownloaded }: ChapterDownloadInfo): boolean {
|
static isDownloaded({ isDownloaded }: ChapterDownloadInfo): boolean {
|
||||||
|
|||||||
Reference in New Issue
Block a user