Update dependency "apollo-client" to v4.x
v4.1.6
This commit is contained in:
@@ -103,6 +103,10 @@ export const useManageMangaLibraryState = (
|
||||
makeToast(t`Could not load categories`, 'error', getErrorMessage(e));
|
||||
return;
|
||||
}
|
||||
if (!categories.data) {
|
||||
return;
|
||||
}
|
||||
|
||||
const userCreatedCategories = Categories.getUserCreated(categories.data.categories.nodes);
|
||||
|
||||
let duplicatedLibraryMangas:
|
||||
@@ -135,8 +139,8 @@ export const useManageMangaLibraryState = (
|
||||
);
|
||||
}
|
||||
|
||||
const doDuplicatesExist = duplicatedLibraryMangas?.data.mangas.totalCount;
|
||||
if (doDuplicatesExist) {
|
||||
const duplicateMangas = duplicatedLibraryMangas?.data?.mangas;
|
||||
if (duplicateMangas?.totalCount) {
|
||||
await Confirmation.show(
|
||||
{
|
||||
title: t`Are you sure?`,
|
||||
@@ -146,7 +150,7 @@ export const useManageMangaLibraryState = (
|
||||
show: true,
|
||||
title: t`Show entry`,
|
||||
contain: true,
|
||||
link: AppRoutes.manga.path(duplicatedLibraryMangas!.data.mangas.nodes[0].id),
|
||||
link: AppRoutes.manga.path(duplicateMangas.nodes[0].id),
|
||||
},
|
||||
confirm: {
|
||||
title: t`Add`,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { useCallback, useState } from 'react';
|
||||
import { ApolloError } from '@apollo/client';
|
||||
import { CombinedGraphQLErrors } from '@apollo/client';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { baseCleanup } from '@/base/utils/Strings.ts';
|
||||
|
||||
@@ -23,7 +23,7 @@ export const useRefreshManga = (mangaId: string) => {
|
||||
requestManager.getMangaChaptersFetch(mangaId, { awaitRefetchQueries: true }).response,
|
||||
])
|
||||
.catch((e) => {
|
||||
if (e instanceof ApolloError && baseCleanup(e.message) === 'no chapters found') {
|
||||
if (CombinedGraphQLErrors.is(e) && baseCleanup(e.message) === 'no chapters found') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import Stack from '@mui/material/Stack';
|
||||
import Box from '@mui/material/Box';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { useLocation, useParams } from 'react-router-dom';
|
||||
import { isNetworkRequestInFlight } from '@apollo/client/core/networkStatus';
|
||||
import { isNetworkRequestInFlight } from '@apollo/client/utilities';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { DocumentNode, Unmasked } from '@apollo/client/core';
|
||||
import { DocumentNode, Unmasked } from '@apollo/client';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { i18n } from '@/i18n';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
@@ -197,7 +197,7 @@ export class Mangas {
|
||||
state: Pick<ChapterConditionInput, 'isRead' | 'isDownloaded' | 'isBookmarked'>,
|
||||
): Promise<GetMangasChapterIdsWithStateQuery['chapters']['nodes']> {
|
||||
const { data } = await requestManager.getMangasChapterIdsWithState(mangaIds, state).response;
|
||||
return data.chapters.nodes;
|
||||
return data?.chapters.nodes ?? [];
|
||||
}
|
||||
|
||||
static async downloadChapters(
|
||||
@@ -519,7 +519,7 @@ export class Mangas {
|
||||
getMetadataServerSettings(),
|
||||
]);
|
||||
|
||||
if (!mangaToMigrateData.manga || !mangaToMigrateToData?.fetchManga?.manga) {
|
||||
if (!mangaToMigrateData?.manga || !mangaToMigrateToData?.fetchManga?.manga) {
|
||||
throw new Error('Mangas::migrate: missing manga data');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user