Temporarily disable highlight on release

This commit is contained in:
Jackson Harper
2024-08-21 10:24:18 +08:00
parent 1030e962a6
commit 1ba7fc3783

View File

@ -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<Highlight | undefined>(undefined)
const [selectionData, setSelectionData] = useSelection(highlightLocations)
const [labelsTarget, setLabelsTarget] = useState<Highlight | undefined>(
undefined
)
const [labelsTarget, setLabelsTarget] =
useState<Highlight | undefined>(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) {