fix bookmarks end condition retrieval

This commit is contained in:
Nicolas Constant 2020-08-28 23:00:53 -04:00
parent 505f0b025a
commit fbe5a53f60
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 7 additions and 0 deletions

View File

@ -58,6 +58,11 @@ export class BookmarksComponent extends TimelineBase {
this.mastodonService.getBookmarks(this.account)
.then((result: BookmarkResult) => {
this.maxId = result.max_id;
if(!this.maxId){
this.lastCallReachedMax = true;
}
for (const s of result.bookmarked) {
let cwPolicy = this.toolsService.checkContentWarning(s);
const wrapper = new StatusWrapper(cwPolicy.status, this.account, cwPolicy.applyCw, cwPolicy.hide);
@ -73,6 +78,8 @@ export class BookmarksComponent extends TimelineBase {
}
protected getNextStatuses(): Promise<Status[]> {
if(this.lastCallReachedMax) return Promise.resolve([]);
return this.mastodonService.getBookmarks(this.account, this.maxId)
.then((result: BookmarkResult) => {
const statuses = result.bookmarked;