From 84d8a54e67c41000398b7abe3571ef0f0494924f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 30 Nov 2024 22:07:25 +0100 Subject: [PATCH] [v2-10-test] fix gantt flickering #42215 (#44488) (#44517) (cherry picked from commit 0c354e7f6a34ab05b4ce239ece77fd05bbffe9a5) Co-authored-by: darkag --- .../www/static/js/dag/details/gantt/index.tsx | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/airflow/www/static/js/dag/details/gantt/index.tsx b/airflow/www/static/js/dag/details/gantt/index.tsx index 45c10d2b525e5..1ed5c353debba 100644 --- a/airflow/www/static/js/dag/details/gantt/index.tsx +++ b/airflow/www/static/js/dag/details/gantt/index.tsx @@ -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);