RemoteTimeline: reorganize useEffect

site-logo
Alex Gleason 2 years ago
parent 57cfd9b18e
commit c66790a39e
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -44,6 +44,14 @@ const RemoteTimeline: React.FC<IRemoteTimeline> = ({ 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<IRemoteTimeline> = ({ params }) => {
};
}, [onlyMedia]);
const handleCloseClick: React.MouseEventHandler = () => {
history.push('/timeline/fediverse');
};
const handleLoadMore = (maxId: string) => {
dispatch(expandRemoteTimeline(instance, { maxId, onlyMedia }));
};
return (
<Column label={intl.formatMessage(messages.title)} heading={instance} transparent>
{instance && <PinnedHostsPicker host={instance} />}

Loading…
Cancel
Save