Просмотр исходного кода

Fix "update in progress" error when removing highlight ranges (#21024)

GitOrigin-RevId: 025e69f10b6010fe978ac57838ae17c113358633
Domagoj Kriskovic 2 лет назад
Родитель
Сommit
e00831761a

+ 3 - 1
services/web/frontend/js/features/review-panel-new/components/review-panel-entry.tsx

@@ -70,7 +70,9 @@ export const ReviewPanelEntry: FC<{
   useEffect(() => {
   useEffect(() => {
     return () => {
     return () => {
       if (hoverRanges) {
       if (hoverRanges) {
-        view.dispatch(clearHighlightRanges(op))
+        setTimeout(() => {
+          view.dispatch(clearHighlightRanges(op))
+        })
       }
       }
     }
     }
   }, []) // eslint-disable-line react-hooks/exhaustive-deps
   }, []) // eslint-disable-line react-hooks/exhaustive-deps