Kaynağa Gözat

:recycle: adjusting getPosts

tags/0.9.0
J 4 yıl önce
ebeveyn
işleme
dc4143431c

+ 6
- 7
vue-theme/src/pages/list.vue Dosyayı Görüntüle

113
             }
113
             }
114
         },
114
         },
115
         async getPosts() {
115
         async getPosts() {
116
-            // Edge case for episodes
117
-            await this._getAll('episode', this.$store)
118
-            const ignore = [`getMoreEpisodes`, 'getMorePages']
119
-
116
+            
120
             let dispatchAction = `getMore${this.pType}`
117
             let dispatchAction = `getMore${this.pType}`
121
             let params = this._getDispatchParams()
118
             let params = this._getDispatchParams()
122
-
123
-            // For material sort we grab EVERYTHING
124
-            if(this._getSortBy() == sortTypes.material && this.type == 'artist') {
119
+            
120
+            // For episodes or material sort we grab EVERYTHING
121
+            if(this.type == 'episde' || this.type == 'artist' && this._getSortBy() == sortTypes.material) {
125
                 dispatchAction = `getAll${this.pType}`
122
                 dispatchAction = `getAll${this.pType}`
126
                 params = this._getDispatchParams(-1)
123
                 params = this._getDispatchParams(-1)
124
+                this.keepFetching = false
127
             }
125
             }
128
 
126
 
127
+            const ignore = [`getMoreEpisodes`, 'getMorePages']
129
             let res = null
128
             let res = null
130
             if(this.pType && !ignore.includes(dispatchAction) && this.keepFetching) {
129
             if(this.pType && !ignore.includes(dispatchAction) && this.keepFetching) {
131
                 res = await this.$store.dispatch(dispatchAction, params)
130
                 res = await this.$store.dispatch(dispatchAction, params)

+ 1
- 3
vue-theme/src/utils/helpers.js Dosyayı Görüntüle

44
     
44
     
45
     if (!route.params.type) {
45
     if (!route.params.type) {
46
         // Remove blank path sections and match to postTypes array
46
         // Remove blank path sections and match to postTypes array
47
-        type = type
48
-            .filter(pathSection => pathSection != '')
49
-            .filter(pathSection => postTypes.includes(pathSection))
47
+        type = type.filter(pathSection => pathSection && postTypes.includes(pathSection))
50
 
48
 
51
         // Only take the first match
49
         // Only take the first match
52
         type = type[0]
50
         type = type[0]

Loading…
İptal
Kaydet