瀏覽代碼

Update Timeline.vue component, fix integer overflow bug in pagination

Daniel Supernault 5 年之前
父節點
當前提交
fbef8977fd
共有 1 個文件被更改,包括 9 次插入8 次删除
  1. 9 8
      resources/assets/js/components/Timeline.vue

+ 9 - 8
resources/assets/js/components/Timeline.vue

@@ -564,10 +564,7 @@
 					if(this.profile.is_admin == true) {
 						this.modes.mod = true;
 					}
-					$('.profile-card .loader').addClass('d-none');
-					$('.profile-card .contents').removeClass('d-none');
-					$('.profile-card .card-footer').removeClass('d-none');
-					this.expRec();
+					//this.expRec();
 				}).catch(err => {
 					swal(
 						'Oops, something went wrong',
@@ -602,8 +599,8 @@
 					this.feed.push(...data);
 					let ids = data.map(status => status.id);
 					this.ids = ids;
-					this.min_id = Math.max(...ids);
-					this.max_id = Math.min(...ids);
+					this.min_id = Math.max(...ids).toString();
+					this.max_id = Math.min(...ids).toString();
 					this.loading = false;
 					$('.timeline .pagination').removeClass('d-none');
 					// if(this.feed.length == 4) {
@@ -626,6 +623,10 @@
 					$state.complete();
 					return;
 				}
+				if(this.page > 40) {
+					this.loading = false;
+					$state.complete();
+				}
 				let apiUrl = false;
 				switch(this.scope) {
 					case 'home':
@@ -655,8 +656,8 @@
 								self.ids.push(d.id);
 							} 
 						});
-						this.min_id = Math.max(...this.ids);
-						this.max_id = Math.min(...this.ids);
+						this.min_id = Math.max(...this.ids).toString();
+						this.max_id = Math.min(...this.ids).toString();
 						this.page += 1;
 						$state.loaded();
 						this.loading = false;