From c66790a39e4d266ae3bee3542e8fe6ba4ae95dcd Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 11 May 2022 12:22:10 -0500 Subject: [PATCH] RemoteTimeline: reorganize useEffect --- app/soapbox/features/remote_timeline/index.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/soapbox/features/remote_timeline/index.tsx b/app/soapbox/features/remote_timeline/index.tsx index d3560f4a6..c429549f5 100644 --- a/app/soapbox/features/remote_timeline/index.tsx +++ b/app/soapbox/features/remote_timeline/index.tsx @@ -44,6 +44,14 @@ const RemoteTimeline: React.FC = ({ params }) => { } }; + const handleCloseClick: React.MouseEventHandler = () => { + history.push('/timeline/fediverse'); + }; + + const handleLoadMore = (maxId: string) => { + dispatch(expandRemoteTimeline(instance, { maxId, onlyMedia })); + }; + useEffect(() => { disconnect(); dispatch(expandRemoteTimeline(instance, { onlyMedia, maxId: undefined })); @@ -55,14 +63,6 @@ const RemoteTimeline: React.FC = ({ params }) => { }; }, [onlyMedia]); - const handleCloseClick: React.MouseEventHandler = () => { - history.push('/timeline/fediverse'); - }; - - const handleLoadMore = (maxId: string) => { - dispatch(expandRemoteTimeline(instance, { maxId, onlyMedia })); - }; - return ( {instance && }