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 = () => {
|
||||||
postsRendered: true,
|
setState({...state,
|
||||||
});
|
postsRendered: true,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
let endOfTimelineMessage = <></>;
|
let endOfTimelineMessage = <></>;
|
||||||
if (state.postsRendered) {
|
if (state.postsRendered) {
|
||||||
|
|
|
@ -220,13 +220,14 @@ export const PostByData = (props) => {
|
||||||
own,
|
own,
|
||||||
loaded: true
|
loaded: true
|
||||||
});
|
});
|
||||||
|
|
||||||
if (props.onPostLoaded != null) {
|
|
||||||
props.onPostLoaded();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// This is run after the state has been updated
|
||||||
|
props.onPostLoaded();
|
||||||
|
}, [state])
|
||||||
|
|
||||||
const _handleFavourite = async () => {
|
const _handleFavourite = async () => {
|
||||||
let newStatus;
|
let newStatus;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,9 @@ const TimelineView = (props) => {
|
||||||
}
|
}
|
||||||
}, [postsLoaded]);
|
}, [postsLoaded]);
|
||||||
|
|
||||||
_handlePostLoaded = () => setPostsLoaded(postsLoaded + 1);
|
const _handlePostLoaded = () => {
|
||||||
|
setPostsLoaded(postsLoaded + 1);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
|
|
Loading…
Reference in New Issue