Kaynağa Gözat

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

sbkwgh 8 yıl önce
ebeveyn
işleme
0bdc5b30d8
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  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