diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts index dd4f9c69..ad16d481 100644 --- a/src/state/models/feed-view.ts +++ b/src/state/models/feed-view.ts @@ -205,7 +205,6 @@ export class FeedModel { _loadMorePromise: Promise | undefined _loadLatestPromise: Promise | undefined _updatePromise: Promise | undefined - _prefetchedRefresh: GetTimeline.Response | GetAuthorFeed.Response | undefined // data feed: FeedItemModel[] = [] @@ -225,7 +224,6 @@ export class FeedModel { _loadMorePromise: false, _loadLatestPromise: false, _updatePromise: false, - _prefetchedRefresh: false, }, {autoBind: true}, ) @@ -283,15 +281,7 @@ export class FeedModel { * Reset and load */ async refresh() { - if (this._prefetchedRefresh) { - await this._pendingWork() - this._replaceAll(this._prefetchedRefresh) - this.setHasNewLatest(false) - this._xIdle() - } else { - await this.setup(true) - } - this._prefetchedRefresh = undefined + await this.setup(true) } /** @@ -343,8 +333,7 @@ export class FeedModel { } await this._pendingWork() const res = await this._getFeed({limit: 1}) - const prefetchedLatestUri = this._prefetchedRefresh?.data.feed[0]?.uri - const currentLatestUri = prefetchedLatestUri || this.pollCursor + const currentLatestUri = this.pollCursor const receivedLatestUri = res.data.feed[0] ? res.data.feed[0].uri : undefined @@ -353,9 +342,6 @@ export class FeedModel { (this.feed.length === 0 || receivedLatestUri !== currentLatestUri), ) this.setHasNewLatest(hasNewLatest) - if (hasNewLatest && prefetchedLatestUri !== receivedLatestUri) { - this._prefetchedRefresh = await this._getFeed({limit: PAGE_SIZE}) - } } // state transitions