Reduce requested source data in queries

This commit is contained in:
schroda
2024-07-03 23:15:50 +02:00
parent 2fa1de578c
commit 7556ea9b38
18 changed files with 368 additions and 468 deletions

View File

@@ -17,11 +17,11 @@ import Typography from '@mui/material/Typography';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router-dom';
import { TPartialSource } from '@/typings';
import { requestManager } from '@/lib/requests/RequestManager.ts';
import { translateExtensionLanguage } from '@/screens/util/Extensions';
import { SourceContentType } from '@/screens/SourceMangas';
import { SpinnerImage } from '@/components/util/SpinnerImage.tsx';
import { GetSourcesListQuery } from '@/lib/graphql/generated/graphql.ts';
const MobileWidthButtons = styled('div')(({ theme }) => ({
display: 'flex',
@@ -42,7 +42,7 @@ const WiderWidthButtons = styled('div')(({ theme }) => ({
}));
interface IProps {
source: TPartialSource;
source: GetSourcesListQuery['sources']['nodes'][number];
showSourceRepo: boolean;
}

View File

@@ -16,7 +16,7 @@ import { t as translate } from 'i18next';
import Link from '@mui/material/Link';
import Typography from '@mui/material/Typography';
import { useLongPress } from 'use-long-press';
import { ISource, TManga } from '@/typings';
import { TManga } from '@/typings';
import { makeToast } from '@/components/util/Toast';
import { Mangas } from '@/lib/data/Mangas.ts';
import { SpinnerImage } from '@/components/util/SpinnerImage.tsx';
@@ -25,6 +25,7 @@ import { TrackMangaButton } from '@/components/manga/TrackMangaButton.tsx';
import { useManageMangaLibraryState } from '@/components/manga/useManageMangaLibraryState.tsx';
import { Metadata as BaseMetadata } from '@/components/atoms/Metadata.tsx';
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
import { SourceType } from '@/lib/graphql/generated/graphql.ts';
const DetailsWrapper = styled('div')(({ theme }) => ({
width: '100%',
@@ -159,7 +160,7 @@ interface IProps {
manga: TManga;
}
function getSourceName(source?: ISource | null) {
function getSourceName(source?: Pick<SourceType, 'id' | 'displayName'> | null): string {
if (!source) {
return translate('global.label.unknown');
}