Skip to content

Commit

Permalink
[v2-10-test] fix gantt flickering #42215 (#44488) (#44517)
Browse files Browse the repository at this point in the history
(cherry picked from commit 0c354e7)

Co-authored-by: darkag <[email protected]>
  • Loading branch information
2 people authored and utkarsharma2 committed Dec 9, 2024
1 parent 581c2c2 commit 84d8a54
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions airflow/www/static/js/dag/details/gantt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,10 @@ const Gantt = ({

// Reset state when the dagrun changes
useEffect(() => {
if (startDate !== dagRun?.queuedAt && startDate !== dagRun?.startDate) {
setStartDate(dagRun?.queuedAt || dagRun?.startDate);
}
if (!endDate || endDate !== dagRun?.endDate) {
// @ts-ignore
setEndDate(dagRun?.endDate ?? moment().add(1, "s").toString());
}
}, [
dagRun?.queuedAt,
dagRun?.startDate,
dagRun?.endDate,
startDate,
endDate,
]);
setStartDate(dagRun?.queuedAt || dagRun?.startDate);
// @ts-ignore
setEndDate(dagRun?.endDate ?? moment().add(1, "s").toString());
}, [dagRun?.queuedAt, dagRun?.startDate, dagRun?.endDate]);

const numBars = Math.round(width / 100);
const runDuration = getDuration(startDate, endDate);
Expand Down

0 comments on commit 84d8a54

Please sign in to comment.