Przeglądaj źródła

:recycle: adjusting getPosts

tags/0.9.0
J 4 lat temu
rodzic
commit
dc4143431c
2 zmienionych plików z 7 dodań i 10 usunięć
  1. 6
    7
      vue-theme/src/pages/list.vue
  2. 1
    3
      vue-theme/src/utils/helpers.js

+ 6
- 7
vue-theme/src/pages/list.vue Wyświetl plik

@@ -113,19 +113,18 @@ export default {
113 113
             }
114 114
         },
115 115
         async getPosts() {
116
-            // Edge case for episodes
117
-            await this._getAll('episode', this.$store)
118
-            const ignore = [`getMoreEpisodes`, 'getMorePages']
119
-
116
+            
120 117
             let dispatchAction = `getMore${this.pType}`
121 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 122
                 dispatchAction = `getAll${this.pType}`
126 123
                 params = this._getDispatchParams(-1)
124
+                this.keepFetching = false
127 125
             }
128 126
 
127
+            const ignore = [`getMoreEpisodes`, 'getMorePages']
129 128
             let res = null
130 129
             if(this.pType && !ignore.includes(dispatchAction) && this.keepFetching) {
131 130
                 res = await this.$store.dispatch(dispatchAction, params)

+ 1
- 3
vue-theme/src/utils/helpers.js Wyświetl plik

@@ -44,9 +44,7 @@ const typeFromRoute = route => {
44 44
     
45 45
     if (!route.params.type) {
46 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 49
         // Only take the first match
52 50
         type = type[0]

Ładowanie…
Anuluj
Zapisz