Ensure event actually fires when the timeline is loaded
This commit is contained in:
parent
f889540ba5
commit
04fb46404f
|
@ -64,9 +64,11 @@ const Feed = (props) => {
|
|||
);
|
||||
}, []);
|
||||
|
||||
const _handleTimelineLoaded = () => setState({...state,
|
||||
const _handleTimelineLoaded = () => {
|
||||
setState({...state,
|
||||
postsRendered: true,
|
||||
});
|
||||
};
|
||||
|
||||
let endOfTimelineMessage = <></>;
|
||||
if (state.postsRendered) {
|
||||
|
|
|
@ -220,13 +220,14 @@ export const PostByData = (props) => {
|
|||
own,
|
||||
loaded: true
|
||||
});
|
||||
|
||||
if (props.onPostLoaded != null) {
|
||||
props.onPostLoaded();
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// This is run after the state has been updated
|
||||
props.onPostLoaded();
|
||||
}, [state])
|
||||
|
||||
const _handleFavourite = async () => {
|
||||
let newStatus;
|
||||
|
||||
|
|
|
@ -23,7 +23,9 @@ const TimelineView = (props) => {
|
|||
}
|
||||
}, [postsLoaded]);
|
||||
|
||||
_handlePostLoaded = () => setPostsLoaded(postsLoaded + 1);
|
||||
const _handlePostLoaded = () => {
|
||||
setPostsLoaded(postsLoaded + 1);
|
||||
}
|
||||
|
||||
return (
|
||||
<View>
|
||||
|
|
Loading…
Reference in New Issue