瀏覽代碼

:recycle: no dispatch if getting moreEpisodes

tags/0.9.0
J 4 年之前
父節點
當前提交
37e4563741
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7
    3
      vue-theme/src/pages/list.vue

+ 7
- 3
vue-theme/src/pages/list.vue 查看文件

@@ -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() {

Loading…
取消
儲存