From b05660dc820d3d02a01954069224b4e089dfec6c Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Tue, 17 Sep 2024 03:48:21 +0200 Subject: [PATCH] Remove scroll to top on library filter change --- src/components/library/LibraryMangaGrid.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/library/LibraryMangaGrid.tsx b/src/components/library/LibraryMangaGrid.tsx index 71393e4a..57ff4177 100644 --- a/src/components/library/LibraryMangaGrid.tsx +++ b/src/components/library/LibraryMangaGrid.tsx @@ -6,8 +6,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -import React, { useEffect, useLayoutEffect } from 'react'; -import { StringParam, useQueryParam } from 'use-query-params'; +import React, { useLayoutEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { GridLayout, useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext'; import { IMangaGridProps, MangaGrid } from '@/components/MangaGrid'; @@ -27,13 +26,8 @@ export const LibraryMangaGrid: React.FC = ({ }) => { const { t } = useTranslation(); - const [query] = useQueryParam('query', StringParam); const { options } = useLibraryOptionsContext(); - useEffect(() => { - window.scrollTo(0, 0); - }, [query, options.hasUnreadChapters, options.hasDownloadedChapters]); - useLayoutEffect(() => { document.body.style.overflowY = options.gridLayout === GridLayout.List ? 'auto' : 'scroll'; return () => {