mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Sync highlight deletions on PDFs
This commit is contained in:
parent
49acfd71cb
commit
f4d2726db7
1 changed files with 12 additions and 1 deletions
|
|
@ -136,14 +136,25 @@ export default function PdfArticleContainer(
|
|||
id: 'tooltip-remove-annotation',
|
||||
className: 'TooltipItem-Remove',
|
||||
onPress: () => {
|
||||
const annotationId = annotationOmnivoreId(annotation)
|
||||
|
||||
instance
|
||||
.delete(annotation)
|
||||
.then(() => {
|
||||
const annotationId = annotationOmnivoreId(annotation)
|
||||
if (annotationId) {
|
||||
return deleteHighlightMutation(annotationId)
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
const highlightIdx = highlightsRef.current.findIndex(
|
||||
(value) => {
|
||||
return value.id == annotationId
|
||||
}
|
||||
)
|
||||
if (highlightIdx > -1) {
|
||||
highlightsRef.current.splice(highlightIdx, 1)
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
showErrorToast('Error deleting highlight: ' + err)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue