|
|
@@ -103,8 +103,10 @@ export default {
|
|
103
|
103
|
}
|
|
104
|
104
|
},
|
|
105
|
105
|
async getPosts() {
|
|
|
106
|
+ // Edge case for episodes
|
|
|
107
|
+ await this._getAll('episode', this.$store)
|
|
|
108
|
+
|
|
106
|
109
|
const dispatchAction = `getMore${this.pType}`
|
|
107
|
|
- // pType sometimes is undefined so need to dispatch and
|
|
108
|
110
|
let res = null
|
|
109
|
111
|
if(this.pType && dispatchAction != `getMoreEpisodes`) {
|
|
110
|
112
|
res = await this.$store.dispatch(
|
|
|
@@ -113,9 +115,6 @@ export default {
|
|
113
|
115
|
)
|
|
114
|
116
|
}
|
|
115
|
117
|
|
|
116
|
|
- // Edge case for episodes
|
|
117
|
|
- await this._getAll('episode', this.$store)
|
|
118
|
|
-
|
|
119
|
118
|
// Stop trying to load more posts
|
|
120
|
119
|
if(res && !res.length) {
|
|
121
|
120
|
console.warn('nothing left to get...')
|
|
|
@@ -147,7 +146,7 @@ export default {
|
|
147
|
146
|
|
|
148
|
147
|
window.addEventListener("load", e => {
|
|
149
|
148
|
const observer = new IntersectionObserver(this.loadMorePosts, {
|
|
150
|
|
- rootMargin: "0px 0px 20px 0px",
|
|
|
149
|
+ rootMargin: "0px 0px -50px 0px",
|
|
151
|
150
|
})
|
|
152
|
151
|
observer.observe(footerEl)
|
|
153
|
152
|
}, false)
|
|
|
@@ -168,18 +167,12 @@ export default {
|
|
168
|
167
|
}
|
|
169
|
168
|
},
|
|
170
|
169
|
watch: {
|
|
|
170
|
+ // This only fires navigating from
|
|
|
171
|
+ // a list page, to another list page
|
|
171
|
172
|
type(newType, oldType){
|
|
172
|
173
|
console.log('old:', oldType)
|
|
173
|
174
|
console.log('new:', newType)
|
|
174
|
|
- },
|
|
175
|
|
- // This only fires navigating from
|
|
176
|
|
- // a list page, to another list page
|
|
177
|
|
- $route(to, from) {
|
|
178
|
|
- // Always reset the page count & fetch flag
|
|
179
|
|
- console.log('route to:', to)
|
|
180
|
|
- console.log('route from:', from)
|
|
181
|
|
- if(to.fullPath.split('/').length < 1) return
|
|
182
|
|
- // this.clearAndInitPostList()
|
|
|
175
|
+ this.clearAndInitPostList()
|
|
183
|
176
|
},
|
|
184
|
177
|
},
|
|
185
|
178
|
mounted() {
|