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