gantt-task-react-powern 0.4.22 → 0.4.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2795,27 +2795,20 @@ var Gantt = function Gantt(_ref) {
2795
2795
  }
2796
2796
 
2797
2797
  function colorPath(path, color, tasks) {
2798
- var _loop = function _loop(i) {
2799
- var task = tasks.find(function (otherTask) {
2800
- return path[i].id === otherTask.id;
2801
- });
2798
+ for (var i = 0; i < path.length; i++) {
2799
+ for (var j = 0; j < tasks.length; j++) {
2800
+ if (path[i].id.startsWith(tasks[j].id + ".") || path[i].id === tasks[j].id) {
2801
+ var _tasks$j$styles;
2802
2802
 
2803
- while (task) {
2804
- if (!task.styles) task.styles = {};
2805
- task.styles.criticalPathColor = color;
2806
- task = tasks.find(function (otherTask) {
2807
- var _task;
2803
+ var _styles = (_tasks$j$styles = tasks[j].styles) != null ? _tasks$j$styles : {};
2808
2804
 
2809
- return (_task = task) === null || _task === void 0 ? void 0 : _task.id.startsWith(otherTask.id + ".");
2810
- });
2805
+ _styles.criticalPathColor = color;
2806
+ tasks[j].styles = _styles;
2807
+ }
2811
2808
  }
2812
- };
2813
-
2814
- for (var i = 0; i < path.length; i++) {
2815
- _loop(i);
2816
2809
  }
2817
2810
 
2818
- var _loop2 = function _loop2(_i) {
2811
+ var _loop = function _loop(_i) {
2819
2812
  var arrows = path[_i].criticalPathArrows;
2820
2813
  if (!arrows) arrows = [];
2821
2814
  var arrow = arrows.find(function (arrow) {
@@ -2829,7 +2822,7 @@ var Gantt = function Gantt(_ref) {
2829
2822
  };
2830
2823
 
2831
2824
  for (var _i = 0; _i + 1 < path.length; _i++) {
2832
- _loop2(_i);
2825
+ _loop(_i);
2833
2826
  }
2834
2827
  }
2835
2828