this.newsList = res.newsList;
const L = res.newsList.length;
if (L > 0) this.cursor = res.newsList[L - 1].added;
+ else this.hasMore = false;
}
}
);
{
data: { cursor: this.cursor },
success: (res) => {
- if (res.newsList.length > 0) {
+ const L = res.newsList.length;
+ if (L > 0) {
this.newsList = this.newsList.concat(res.newsList);
- const L = res.newsList.length;
- if (L > 0) this.cursor = res.newsList[L - 1].added;
+ this.cursor = res.newsList[L - 1].added;
} else this.hasMore = false;
}
}