From edb66bd4e4acc2d4f3747401f71a19a1f637e3d8 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Tue, 29 Oct 2024 13:52:17 +1100 Subject: [PATCH] Remove unnecessary scroll to top on mount for top level query pages (#5288) --- ui/v2.5/src/components/Galleries/Galleries.tsx | 3 --- ui/v2.5/src/components/Groups/Groups.tsx | 3 --- ui/v2.5/src/components/Images/Images.tsx | 3 --- ui/v2.5/src/components/Performers/Performers.tsx | 3 --- ui/v2.5/src/components/Scenes/Scenes.tsx | 5 ----- ui/v2.5/src/components/Studios/Studios.tsx | 3 --- ui/v2.5/src/components/Tags/Tags.tsx | 3 --- 7 files changed, 23 deletions(-) diff --git a/ui/v2.5/src/components/Galleries/Galleries.tsx b/ui/v2.5/src/components/Galleries/Galleries.tsx index db3db8ddd..c845a153c 100644 --- a/ui/v2.5/src/components/Galleries/Galleries.tsx +++ b/ui/v2.5/src/components/Galleries/Galleries.tsx @@ -5,7 +5,6 @@ import { useTitleProps } from "src/hooks/title"; import Gallery from "./GalleryDetails/Gallery"; import GalleryCreate from "./GalleryDetails/GalleryCreate"; import { GalleryList } from "./GalleryList"; -import { useScrollToTopOnMount } from "src/hooks/scrollToTop"; import { View } from "../List/views"; import { LoadingIndicator } from "../Shared/LoadingIndicator"; import { ErrorMessage } from "../Shared/ErrorMessage"; @@ -41,8 +40,6 @@ const GalleryImage: React.FC> = ({ }; const Galleries: React.FC = () => { - useScrollToTopOnMount(); - return ; }; diff --git a/ui/v2.5/src/components/Groups/Groups.tsx b/ui/v2.5/src/components/Groups/Groups.tsx index a2e4d9083..5ec7b4eaf 100644 --- a/ui/v2.5/src/components/Groups/Groups.tsx +++ b/ui/v2.5/src/components/Groups/Groups.tsx @@ -5,12 +5,9 @@ import { useTitleProps } from "src/hooks/title"; import Group from "./GroupDetails/Group"; import GroupCreate from "./GroupDetails/GroupCreate"; import { GroupList } from "./GroupList"; -import { useScrollToTopOnMount } from "src/hooks/scrollToTop"; import { View } from "../List/views"; const Groups: React.FC = () => { - useScrollToTopOnMount(); - return ; }; diff --git a/ui/v2.5/src/components/Images/Images.tsx b/ui/v2.5/src/components/Images/Images.tsx index c0a6b67c8..91edfdf79 100644 --- a/ui/v2.5/src/components/Images/Images.tsx +++ b/ui/v2.5/src/components/Images/Images.tsx @@ -4,12 +4,9 @@ import { Helmet } from "react-helmet"; import { useTitleProps } from "src/hooks/title"; import Image from "./ImageDetails/Image"; import { ImageList } from "./ImageList"; -import { useScrollToTopOnMount } from "src/hooks/scrollToTop"; import { View } from "../List/views"; const Images: React.FC = () => { - useScrollToTopOnMount(); - return ; }; diff --git a/ui/v2.5/src/components/Performers/Performers.tsx b/ui/v2.5/src/components/Performers/Performers.tsx index 96c44e938..d240ce988 100644 --- a/ui/v2.5/src/components/Performers/Performers.tsx +++ b/ui/v2.5/src/components/Performers/Performers.tsx @@ -5,12 +5,9 @@ import { useTitleProps } from "src/hooks/title"; import Performer from "./PerformerDetails/Performer"; import PerformerCreate from "./PerformerDetails/PerformerCreate"; import { PerformerList } from "./PerformerList"; -import { useScrollToTopOnMount } from "src/hooks/scrollToTop"; import { View } from "../List/views"; const Performers: React.FC = () => { - useScrollToTopOnMount(); - return ; }; diff --git a/ui/v2.5/src/components/Scenes/Scenes.tsx b/ui/v2.5/src/components/Scenes/Scenes.tsx index 7e8031ab5..a9124fb8f 100644 --- a/ui/v2.5/src/components/Scenes/Scenes.tsx +++ b/ui/v2.5/src/components/Scenes/Scenes.tsx @@ -3,7 +3,6 @@ import { Route, Switch } from "react-router-dom"; import { Helmet } from "react-helmet"; import { useTitleProps } from "src/hooks/title"; import { lazyComponent } from "src/utils/lazyComponent"; -import { useScrollToTopOnMount } from "src/hooks/scrollToTop"; import { View } from "../List/views"; const SceneList = lazyComponent(() => import("./SceneList")); @@ -12,14 +11,10 @@ const Scene = lazyComponent(() => import("./SceneDetails/Scene")); const SceneCreate = lazyComponent(() => import("./SceneDetails/SceneCreate")); const Scenes: React.FC = () => { - useScrollToTopOnMount(); - return ; }; const SceneMarkers: React.FC = () => { - useScrollToTopOnMount(); - const titleProps = useTitleProps({ id: "markers" }); return ( <> diff --git a/ui/v2.5/src/components/Studios/Studios.tsx b/ui/v2.5/src/components/Studios/Studios.tsx index e60dbdc06..545de936f 100644 --- a/ui/v2.5/src/components/Studios/Studios.tsx +++ b/ui/v2.5/src/components/Studios/Studios.tsx @@ -5,12 +5,9 @@ import { useTitleProps } from "src/hooks/title"; import Studio from "./StudioDetails/Studio"; import StudioCreate from "./StudioDetails/StudioCreate"; import { StudioList } from "./StudioList"; -import { useScrollToTopOnMount } from "src/hooks/scrollToTop"; import { View } from "../List/views"; const Studios: React.FC = () => { - useScrollToTopOnMount(); - return ; }; diff --git a/ui/v2.5/src/components/Tags/Tags.tsx b/ui/v2.5/src/components/Tags/Tags.tsx index 5ed35448e..806a0f7a6 100644 --- a/ui/v2.5/src/components/Tags/Tags.tsx +++ b/ui/v2.5/src/components/Tags/Tags.tsx @@ -5,11 +5,8 @@ import { useTitleProps } from "src/hooks/title"; import Tag from "./TagDetails/Tag"; import TagCreate from "./TagDetails/TagCreate"; import { TagList } from "./TagList"; -import { useScrollToTopOnMount } from "src/hooks/scrollToTop"; const Tags: React.FC = () => { - useScrollToTopOnMount(); - return ; };