浏览代码

Fix bug where on changing route/category, method would load nextURL of current category rather than new category

sbkwgh 8 年之前
父节点
当前提交
0bdc5b30d8
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/components/routes/Index.vue

+ 6 - 1
src/components/routes/Index.vue

@@ -142,10 +142,15 @@
 			getThreads (initial) {
 				if(this.nextURL === null && !initial) return
 
+				let URL = '/api/v1/category/' + this.selectedCategory
+				if(!initial) {
+					URL = this.nextURL || URL
+				}
+
 				this.loading = true
 
 				this.axios
-					.get(this.nextURL || '/api/v1/category/' + this.selectedCategory)
+					.get(URL)
 					.then(res => {
 						this.loading = false