From 0b96b300d39bc215a64a94f15621982f234335c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Sat, 10 Aug 2019 03:50:24 +0200 Subject: [PATCH] Implement hasMore feature on the index page --- webapp/pages/index.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/pages/index.vue b/webapp/pages/index.vue index 5f0e9c115..9c9e61070 100644 --- a/webapp/pages/index.vue +++ b/webapp/pages/index.vue @@ -33,7 +33,7 @@ primary /> - + @@ -55,6 +55,7 @@ export default { const { hashtag = null } = this.$route.query return { posts: [], + hasMore: true, // Initialize your apollo data offset: 0, pageSize: 12, @@ -156,6 +157,7 @@ export default { // TODO: find out why `update` gets called twice initially. // We have to filter for uniq posts only because we get the same // result set twice. + this.hasMore = !!Post.length const posts = uniqBy([...this.posts, ...Post], 'id') this.posts = posts },