|
|
@@ -108,20 +108,23 @@ export default {
|
|
108
|
108
|
if(!this.type) throw `post type: ${this.type} not found...`
|
|
109
|
109
|
|
|
110
|
110
|
// Set some default dispatch paramters
|
|
111
|
|
- let dispatchAction = 'More'
|
|
|
111
|
+ let dispatchType = 'More'
|
|
112
|
112
|
let params = { limit: this.perPage, page: this.page }
|
|
113
|
113
|
|
|
114
|
114
|
// For episodes, or material sort we grab EVERYTHING
|
|
115
|
115
|
const getAllClause = this.type == 'episode' || this.type == 'artist' && this.sortBy == sortTypes.material
|
|
116
|
116
|
if(getAllClause) {
|
|
117
|
|
- dispatchAction = 'All'
|
|
|
117
|
+ // dispatchType = 'All'
|
|
118
|
118
|
params.limit = -1
|
|
119
|
119
|
}
|
|
120
|
120
|
|
|
121
|
121
|
let res = []
|
|
122
|
122
|
// We always grab all pages on hero init so no need to do it here
|
|
123
|
123
|
if(this.pType && this.keepFetching && this.type != 'page') {
|
|
124
|
|
- res = await this.$store.dispatch(`get${dispatchAction}${this.pType}`, { sortType: this.sortBy, params })
|
|
|
124
|
+ res = await this.$store.dispatch(
|
|
|
125
|
+ `get${dispatchType}${this.pType}`,
|
|
|
126
|
+ { sortType: this.sortBy, params }
|
|
|
127
|
+ )
|
|
125
|
128
|
}
|
|
126
|
129
|
|
|
127
|
130
|
// Stop trying to load more posts
|
|
|
@@ -203,20 +206,15 @@ export default {
|
|
203
|
206
|
// Ignore types with presorts so the sortBy watcher can handle them
|
|
204
|
207
|
const ignore = ['event', 'exhibition', 'artist']
|
|
205
|
208
|
if(ignore.includes(newType)) return
|
|
206
|
|
-
|
|
207
|
209
|
this.clearAndInitPostList('type change')
|
|
208
|
210
|
},
|
|
209
|
211
|
sortBy(newSort) {
|
|
210
|
|
- if(Object.values(sortTypes).includes(newSort)) {
|
|
211
|
|
- this.clearAndInitPostList('sort change')
|
|
212
|
|
- }
|
|
|
212
|
+ if(!Object.values(sortTypes).includes(newSort)) return
|
|
|
213
|
+ this.clearAndInitPostList('sort change')
|
|
213
|
214
|
}
|
|
214
|
215
|
},
|
|
215
|
216
|
mounted() {
|
|
216
|
217
|
// This only fires navigating from a non-list page > list page
|
|
217
|
|
- console.log(this.$route)
|
|
218
|
|
- console.log(this.type)
|
|
219
|
|
- console.log(this.sortBy)
|
|
220
|
218
|
this.clearAndInitPostList('mounted')
|
|
221
|
219
|
},
|
|
222
|
220
|
beforeDestroy() {
|