If I post in a community, the feed goes blank, then is... doubled?
Closed this issue · 3 comments
Ok so it's fixed I guess bc I turned prefill off and so the infinite scroll script stopped making the request for the exact same posts twice, which is what it was doing. And the reason the feed coming up blank after making a post initially was I guess because that was another prefill situation and it was just deciding to make the same showposts request again and the most recent request was, in the case of your two-posts community, the one where you reached the bottom of the feed and it 404ed. No idea why prefill wasn't running the code in the on append event listener and updating the needPostsOlderThan variable so that it would make an accurate next request, like, that code works fine when it runs because you scrolled down. But while I'm thinking of it some code needs to be added to the very botton of the on append event listener in onPostsLoadScripts to be like "if the document height is not currently actually larger than the window height, do the loadNextPage command." And that combined with the loadNextPage command in restartInfiniteScroll and after startInfiniteScroll will be our non-malfunctioning replacement for prefill, yeehaw.