From bed9be1f81b119922eb84fb662ce62a567ed6d6d Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Fri, 19 Jun 2026 18:40:44 +0200 Subject: [PATCH] fix: resolve react-hooks/rules-of-hooks in Annotator --- components/annotator-local/Annotator.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/annotator-local/Annotator.tsx b/components/annotator-local/Annotator.tsx index 851f9f3db..edd768917 100644 --- a/components/annotator-local/Annotator.tsx +++ b/components/annotator-local/Annotator.tsx @@ -70,8 +70,6 @@ export function Annotator({ assets = [], onSubmit }: AnnotatorProps) { return window.self !== window.top; }, []); - if (isExcluded) return null; - const getSelector = (el: HTMLElement): string => { try { return finder(el, { @@ -236,6 +234,8 @@ export function Annotator({ assets = [], onSubmit }: AnnotatorProps) { const hoveredRect = useMemo(() => hoveredElement?.getBoundingClientRect(), [hoveredElement, updateTick]); const selectedRect = useMemo(() => selectedElement?.getBoundingClientRect(), [selectedElement, updateTick]); + if (isExcluded) return null; + return (
{/* 1. Global Toolbar */}