浏览代码

:poop: ternary attempt

tags/0.9.0
J 4 年前
父节点
当前提交
1f76637dd7
共有 1 个文件被更改,包括 6 次插入12 次删除
  1. 6
    12
      vue-theme/src/pages/list.vue

+ 6
- 12
vue-theme/src/pages/list.vue 查看文件

@@ -85,20 +85,14 @@ export default {
85 85
                       .filter(p => p)
86 86
                       .pop()
87 87
 
88
-            let dispatchParams = { sortType: sort, params }
89
-            let dispatchAction = `getAll${this.pType}`
90
-
91
-            let res = null
92
-            
93
-            if(['event', 'exhibition'].includes(this.type)) {
94
-                dispatchParams.sortType = sortTypes.currentAndUpcoming
95
-            }
96
-            // Add to existing except episodes
97
-            if (!clear) {
98
-                dispatchAction = `getMore${this.pType}`
88
+            let dispatchParams = {
89
+                sortType: ['event', 'exhibition'].includes(this.type) ? sortTypes.currentAndUpcoming : sort,
90
+                params
99 91
             }
92
+            let dispatchAction = clear ? `getAll${this.pType}` : `getMore${this.pType}`
93
+
94
+            const res = await this.$store.dispatch(dispatchAction, dispatchParams)
100 95
 
101
-            res = await this.$store.dispatch(dispatchAction, dispatchParams)
102 96
             if(!res?.length) {
103 97
                 console.warn('nothing left to get...')
104 98
                 console.log('responded:', res)

正在加载...
取消
保存