Only use cursors supplied by the server (ref #59)

zio/stable
Paul Frazee 2023-01-20 10:39:00 -06:00
parent c4cca8cf6c
commit d4b9ef3b0a
3 changed files with 5 additions and 7 deletions

View File

@ -438,10 +438,8 @@ export class FeedModel {
}
this._updateAll(res)
numToFetch -= res.data.feed.length
cursor = this.feed[res.data.feed.length - 1]
? ts(this.feed[res.data.feed.length - 1])
: undefined
} while (numToFetch > 0)
cursor = res.data.cursor
} while (cursor && numToFetch > 0)
this._xIdle()
} catch (e: any) {
this._xIdle(e)

View File

@ -379,8 +379,8 @@ export class NotificationsViewModel {
}
this._updateAll(res)
numToFetch -= res.data.notifications.length
cursor = this.notifications[res.data.notifications.length - 1].indexedAt
} while (numToFetch > 0)
cursor = res.data.cursor
} while (cursor && numToFetch > 0)
this._xIdle()
} catch (e: any) {
this._xIdle(e)

View File

@ -1,6 +1,6 @@
import {makeAutoObservable} from 'mobx'
import {
AppBskyGraphGetFollowers as GetFollows,
AppBskyGraphGetFollows as GetFollows,
AppBskyActorRef as ActorRef,
} from '@atproto/api'
import {RootStoreModel} from './root-store'