浏览代码

Merge pull request #913 from m4sk1n/patch-1

Don't show “load more” if there is nothing more to load
daniel 6 年之前
父节点
当前提交
4905ae5fea
共有 2 个文件被更改,包括 21 次插入5 次删除
  1. 11 3
      resources/assets/js/components/Profile.vue
  2. 10 2
      resources/assets/js/components/Timeline.vue

+ 11 - 3
resources/assets/js/components/Profile.vue

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

+ 10 - 2
resources/assets/js/components/Timeline.vue

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