Merge pull request #913 from m4sk1n/patch-1

Don't show “load more” if there is nothing more to load
This commit is contained in:
daniel 2019-02-28 17:58:41 -07:00 committed by GitHub
commit 4905ae5fea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 5 deletions

View file

@ -671,6 +671,9 @@ export default {
.then(res => { .then(res => {
this.following = res.data; this.following = res.data;
this.followingCursor++; this.followingCursor++;
if(res.data.length < 10) {
this.followingMore = false;
}
}); });
this.$refs.followingModal.show(); this.$refs.followingModal.show();
}, },
@ -688,7 +691,10 @@ export default {
.then(res => { .then(res => {
this.followers = res.data; this.followers = res.data;
this.followerCursor++; this.followerCursor++;
}) if(res.data.length < 10) {
this.followerMore = false;
}
})
this.$refs.followerModal.show(); this.$refs.followerModal.show();
}, },
@ -702,7 +708,8 @@ export default {
if(res.data.length > 0) { if(res.data.length > 0) {
this.following.push(...res.data); this.following.push(...res.data);
this.followingCursor++; this.followingCursor++;
} else { }
if(res.data.length < 10) {
this.followingMore = false; this.followingMore = false;
} }
}); });
@ -719,7 +726,8 @@ export default {
if(res.data.length > 0) { if(res.data.length > 0) {
this.followers.push(...res.data); this.followers.push(...res.data);
this.followerCursor++; this.followerCursor++;
} else { }
if(res.data.length < 10) {
this.followerMore = false; this.followerMore = false;
} }
}); });

View file

@ -892,6 +892,9 @@
this.following = res.data; this.following = res.data;
this.followingCursor++; this.followingCursor++;
}); });
if(res.data.length < 10) {
this.followingMore = false;
}
this.$refs.followingModal.show(); this.$refs.followingModal.show();
}, },
@ -909,6 +912,9 @@
this.followers = res.data; this.followers = res.data;
this.followerCursor++; this.followerCursor++;
}) })
if(res.data.length < 10) {
this.followerMore = false;
}
this.$refs.followerModal.show(); this.$refs.followerModal.show();
}, },
@ -922,7 +928,8 @@
if(res.data.length > 0) { if(res.data.length > 0) {
this.following.push(...res.data); this.following.push(...res.data);
this.followingCursor++; this.followingCursor++;
} else { }
if(res.data.length < 10) {
this.followingMore = false; this.followingMore = false;
} }
}); });
@ -939,7 +946,8 @@
if(res.data.length > 0) { if(res.data.length > 0) {
this.followers.push(...res.data); this.followers.push(...res.data);
this.followerCursor++; this.followerCursor++;
} else { }
if(res.data.length < 10) {
this.followerMore = false; this.followerMore = false;
} }
}); });