Reduce requested category data in queries

This commit is contained in:
schroda
2024-07-01 21:40:27 +02:00
parent 03cfc9b80c
commit 9b8ace003d
19 changed files with 253 additions and 73 deletions

View File

@@ -22,8 +22,8 @@ import { UpdaterSubscription } from '@/lib/graphql/generated/graphql.ts';
import { Progress } from '@/components/util/Progress';
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
import { dateTimeFormatter } from '@/util/date.ts';
import { TCategory } from '@/typings.ts';
import { MediaQuery } from '@/lib/ui/MediaQuery.tsx';
import { CategoryIdInfo } from '@/lib/data/Categories.ts';
const calcProgress = (status: UpdaterSubscription['updateStatusChanged'] | undefined) => {
if (!status) {
@@ -44,7 +44,7 @@ export function UpdateChecker({
categoryId,
handleFinishedUpdate,
}: {
categoryId?: TCategory['id'];
categoryId?: CategoryIdInfo['id'];
handleFinishedUpdate?: () => void;
}) {
const { t } = useTranslation();
@@ -85,7 +85,7 @@ export function UpdateChecker({
reFetchLastTimestamp().catch(defaultPromiseErrorHandler('UpdateChecker::reFetchLastTimestamp'));
}, [status?.isRunning]);
const startUpdate = async (category?: TCategory['id']) => {
const startUpdate = async (category?: CategoryIdInfo['id']) => {
try {
lastRunningState = true;
await requestManager.startGlobalUpdate(category !== undefined ? [category] : undefined).response;
@@ -104,7 +104,7 @@ export function UpdateChecker({
}
};
const onClick = async (category?: TCategory['id']) => {
const onClick = async (category?: CategoryIdInfo['id']) => {
if (isRunning) {
stopUpdate();
} else {