X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FNews.vue;h=66a524918c56f535eafb35e9193f80e9e8edd26c;hb=68e19a449db7a12e0a168e99cd750d985c983ba1;hp=0e3c3c7ae08d18811849d5ee6d0898d25ebd902e;hpb=0234201fb338fc239d6f613c677fa932c7c3697c;p=vchess.git diff --git a/client/src/views/News.vue b/client/src/views/News.vue index 0e3c3c7a..66a52491 100644 --- a/client/src/views/News.vue +++ b/client/src/views/News.vue @@ -68,6 +68,7 @@ export default { this.newsList = res.newsList; const L = res.newsList.length; if (L > 0) this.cursor = res.newsList[L - 1].added; + else this.hasMore = false; } } ); @@ -169,10 +170,10 @@ export default { { 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; } }