Skip to content

Commit

Permalink
fix gantt flickering #42215 (#44488)
Browse files Browse the repository at this point in the history
  • Loading branch information
darkag authored Nov 30, 2024
1 parent eea1071 commit 0c354e7
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 0c354e7

Please sign in to comment.