From 1300c10d83c62a05d36320e143f284c4a1263a25 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sat, 16 Dec 2023 20:38:29 +0100 Subject: [PATCH] Remove unnecessary library refetch The server is now returning up-to-date manga data and thus, it's not necessary to refetch the library anymore after the update is finished --- src/screens/Library.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/screens/Library.tsx b/src/screens/Library.tsx index 27cd15e6..63f45319 100644 --- a/src/screens/Library.tsx +++ b/src/screens/Library.tsx @@ -7,7 +7,7 @@ */ import { Chip, Tab, Tabs, styled, Box } from '@mui/material'; -import React, { useCallback, useContext, useEffect, useMemo } from 'react'; +import React, { useContext, useEffect, useMemo } from 'react'; import { useQueryParam, NumberParam } from 'use-query-params'; import { useTranslation } from 'react-i18next'; import { requestManager } from '@/lib/requests/RequestManager.ts'; @@ -66,7 +66,6 @@ export function Library() { data: categoriesResponse, error: tabsError, loading: areCategoriesLoading, - refetch, } = requestManager.useGetCategories(); const tabsData = categoriesResponse?.categories.nodes.filter( (category) => category.id !== 0 || (category.id === 0 && category.mangas.totalCount), @@ -87,10 +86,6 @@ export function Library() { } = requestManager.useGetCategoryMangas(activeTab?.id, { skip: !activeTab, nextFetchPolicy: 'cache-only' }); const mangas = categoryMangaResponse?.mangas.nodes ?? []; - const handleFinishedUpdate = useCallback(() => { - refetch(); - }, [refetch]); - const { setTitle, setAction } = useContext(NavBarContext); useEffect(() => { const title = t('library.title'); @@ -105,7 +100,7 @@ export function Library() { <> - + , ); return () => {