Browse Source

切换和刷新计时器合并,解决偶尔出现的展示顺序错乱问题。

zhuth 8 years ago
parent
commit
a89e81730b
1 changed files with 2 additions and 10 deletions
  1. 2 10
      kanban-client/app/component/factory.js

+ 2 - 10
kanban-client/app/component/factory.js

@@ -81,24 +81,16 @@ class Factory extends React.Component {
             current: current,
             next: next
         };
-        // 刷新
         if (refresh.current) {
             if (refresh.current.enable) {
                 this.refreshThis = setInterval(function () {
-                    this.getModelConfig(this.props.code[0] + '?kanbanCode=' + codes[this.index]);
-                }.bind(this), refresh.current.interval * 1000 || 10000)
-            }
-        }
-        // 切换
-        if (refresh.next) {
-            if (refresh.next.enable) {
-                this.refreshNext = setInterval(function () {
                     if (this.index == codes.length - 1) {
                         this.index = 0;
                     } else {
                         this.index++;
                     }
-                }.bind(this), refresh.next.interval * 1000 || 30000)
+                    this.getModelConfig(this.props.code[0] + '?kanbanCode=' + codes[this.index]);
+                }.bind(this), refresh.current.interval * 1000 || 10000)
             }
         }
     }