Quellcode durchsuchen

:recycle: trying to simplify initPost from route watch

tags/0.9.0
J vor 4 Jahren
Ursprung
Commit
712deba1d8
1 geänderte Dateien mit 3 neuen und 5 gelöschten Zeilen
  1. 3
    5
      vue-theme/src/pages/list.vue

+ 3
- 5
vue-theme/src/pages/list.vue Datei anzeigen

127
             }
127
             }
128
 
128
 
129
             let res = null
129
             let res = null
130
-            if(this.pType && !ignore.includes(dispatchAction)) {
130
+            if(this.pType && !ignore.includes(dispatchAction) && this.keepFetching) {
131
                 res = await this.$store.dispatch(dispatchAction, params)
131
                 res = await this.$store.dispatch(dispatchAction, params)
132
             }
132
             }
133
 
133
 
198
             this.loadMorePosts()
198
             this.loadMorePosts()
199
         },
199
         },
200
         routeInfoFromPath(fullPath) {
200
         routeInfoFromPath(fullPath) {
201
-            console.log(fullPath)
202
-            console.log(fullPath.split('/'))
203
-            const [ potentialType, potentialSort ] = fullPath.split('/')
204
-            console.log(potentialType)
201
+            const [ potentialType, potentialSort ] = fullPath.split('/').filter(e =>  e)
205
             return {
202
             return {
206
                 sortBy: Object.values(sortTypes).includes(potentialSort) ? potentialSort : null,
203
                 sortBy: Object.values(sortTypes).includes(potentialSort) ? potentialSort : null,
207
                 type: postTypes.includes(potentialType) ? potentialType : null
204
                 type: postTypes.includes(potentialType) ? potentialType : null
237
             ) {
234
             ) {
238
                 const ignore = ['event', 'exhibition', 'post']
235
                 const ignore = ['event', 'exhibition', 'post']
239
                 if(ignore.includes(this.type)) return
236
                 if(ignore.includes(this.type)) return
237
+                console.log('init from $route watch...')
240
                 this.clearAndInitPostList()
238
                 this.clearAndInitPostList()
241
             }
239
             }
242
         }
240
         }

Laden…
Abbrechen
Speichern