From 1ba7fc3783e255a638580f43710a4f448a53b7d7 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 21 Aug 2024 10:24:18 +0800 Subject: [PATCH] Temporarily disable highlight on release --- .../templates/article/HighlightsLayer.tsx | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/web/components/templates/article/HighlightsLayer.tsx b/packages/web/components/templates/article/HighlightsLayer.tsx index 3232accd0..0395e5b0a 100644 --- a/packages/web/components/templates/article/HighlightsLayer.tsx +++ b/packages/web/components/templates/article/HighlightsLayer.tsx @@ -77,15 +77,13 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element { const focusedHighlightMousePos = useRef({ pageX: 0, pageY: 0 }) const [currentHighlightIdx, setCurrentHighlightIdx] = useState(0) - const [focusedHighlight, setFocusedHighlight] = useState< - Highlight | undefined - >(undefined) + const [focusedHighlight, setFocusedHighlight] = + useState(undefined) const [selectionData, setSelectionData] = useSelection(highlightLocations) - const [labelsTarget, setLabelsTarget] = useState( - undefined - ) + const [labelsTarget, setLabelsTarget] = + useState(undefined) const [ confirmDeleteHighlightWithNoteId, @@ -578,12 +576,12 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element { ] ) - useEffect(() => { - if (props.highlightOnRelease) { - handleAction('create') - setSelectionData(null) - } - }, [selectionData, setSelectionData, handleAction, props.highlightOnRelease]) + // useEffect(() => { + // if (props.highlightOnRelease) { + // handleAction('create') + // setSelectionData(null) + // } + // }, [selectionData, setSelectionData, handleAction, props.highlightOnRelease]) const dispatchHighlightError = (action: string, error: unknown) => { if (props.isAppleAppEmbed) {