agent-canvas 0.1.30 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -43,7 +43,8 @@ export function useTextAnnotation(options: UseTextAnnotationOptions) {
|
|
|
43
43
|
const setActiveAnnotationIdRef = useRef(setActiveAnnotationId);
|
|
44
44
|
setActiveAnnotationIdRef.current = setActiveAnnotationId;
|
|
45
45
|
|
|
46
|
-
// Mark restoration after content renders
|
|
46
|
+
// Mark restoration after content renders or annotations change
|
|
47
|
+
const restoreAnnotationsLen = restoreAnnotations.length;
|
|
47
48
|
useEffect(() => {
|
|
48
49
|
if (!containerRef.current) return;
|
|
49
50
|
const timer = setTimeout(() => {
|
|
@@ -52,7 +53,7 @@ export function useTextAnnotation(options: UseTextAnnotationOptions) {
|
|
|
52
53
|
}
|
|
53
54
|
}, 50);
|
|
54
55
|
return () => clearTimeout(timer);
|
|
55
|
-
}, [restoreKey]);
|
|
56
|
+
}, [restoreKey, restoreAnnotationsLen]);
|
|
56
57
|
|
|
57
58
|
// Mark active state tracking
|
|
58
59
|
const prevActiveRef = useRef<string | null>(null);
|