RemoteTimeline: reorganize useEffect
This commit is contained in:
parent
57cfd9b18e
commit
c66790a39e
1 changed files with 8 additions and 8 deletions
|
@ -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…
Reference in a new issue