defer loading of feeds until visible (#1271)

* defer loading of feeds until visible

* Fix: use existing hasLoaded

* Fix: dont query for latest during initial load

---------

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
Eric Bailey 2023-08-24 18:26:29 -05:00 committed by GitHub
parent a5981e127f
commit 4654a9a45e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 37 deletions

View file

@ -272,7 +272,7 @@ export class PostsFeedModel {
* Check if new posts are available
*/
async checkForLatest() {
if (this.hasNewLatest || this.isLoading) {
if (!this.hasLoaded || this.hasNewLatest || this.isLoading) {
return
}
const res = await this._getFeed({limit: 1})