From e9fbea8869ed95f9506923efa63432803cf46e6f Mon Sep 17 00:00:00 2001 From: Oleksandr Danylchenko <68850090+oleksandr-danylchenko@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:17:52 +0200 Subject: [PATCH] Added proper `existingTargetUpdated` existence check --- packages/text-annotator/src/SelectionHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/text-annotator/src/SelectionHandler.ts b/packages/text-annotator/src/SelectionHandler.ts index ce31b82b..510932bd 100644 --- a/packages/text-annotator/src/SelectionHandler.ts +++ b/packages/text-annotator/src/SelectionHandler.ts @@ -320,7 +320,7 @@ export const SelectionHandler = ( const { target: { updated: existingTargetUpdated } } = existingAnnotation; const { updated: currentTargetUpdated } = currentTarget; if ( - !existingAnnotation || + !existingTargetUpdated || !currentTargetUpdated || existingTargetUpdated < currentTargetUpdated ) {