Quellcode durchsuchen

:recycle: no dispatch if getting moreEpisodes

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

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

@@ -90,11 +90,15 @@ export default {
90 90
 
91 91
             const dispatchAction = clear ? `getAll${this.pType}` : `getMore${this.pType}`
92 92
 
93
-            const res = await this.$store.dispatch(dispatchAction, dispatchParams)
93
+            // pType sometimes is undefined so need to dispatch and
94
+            // Episodes only needs load call
95
+            let res = null
96
+            if(this.pType && dispatchAction != `getMoreEpisodes`) {
97
+                res = await this.$store.dispatch(dispatchAction, dispatchParams)
98
+            }
94 99
 
95
-            if(res && res.length < 0) {
100
+            if(res && !res.length) {
96 101
                 console.warn('nothing left to get...')
97
-                console.log('responded:', res)
98 102
             }
99 103
         },
100 104
         clearHero() {

Laden…
Abbrechen
Speichern