From e00831761a8dd4428ba43145a7cda9ba1ac06a88 Mon Sep 17 00:00:00 2001 From: Domagoj Kriskovic Date: Fri, 11 Oct 2024 13:07:18 +0200 Subject: [PATCH] Fix "update in progress" error when removing highlight ranges (#21024) GitOrigin-RevId: 025e69f10b6010fe978ac57838ae17c113358633 --- .../review-panel-new/components/review-panel-entry.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/review-panel-new/components/review-panel-entry.tsx b/services/web/frontend/js/features/review-panel-new/components/review-panel-entry.tsx index ccd2731ea4..c4196eca33 100644 --- a/services/web/frontend/js/features/review-panel-new/components/review-panel-entry.tsx +++ b/services/web/frontend/js/features/review-panel-new/components/review-panel-entry.tsx @@ -70,7 +70,9 @@ export const ReviewPanelEntry: FC<{ useEffect(() => { return () => { if (hoverRanges) { - view.dispatch(clearHighlightRanges(op)) + setTimeout(() => { + view.dispatch(clearHighlightRanges(op)) + }) } } }, []) // eslint-disable-line react-hooks/exhaustive-deps