Skip to content

Commit

Permalink
Only observe modifications of annotations with a modified change type (
Browse files Browse the repository at this point in the history
  • Loading branch information
mvasilak authored Nov 20, 2024
1 parent 5ab1e85 commit 89f2768
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1833,7 +1833,7 @@ final class PDFReaderActionHandler: ViewModelActionHandler, BackgroundDbProcessi
}

func observe(items: Results<RItem>, viewModel: ViewModel<PDFReaderActionHandler>, handler: PDFReaderActionHandler) -> NotificationToken {
return items.observe { [weak handler, weak viewModel] change in
return items.observe(keyPaths: [\RItem.changeType]) { [weak handler, weak viewModel] change in
guard let handler, let viewModel else { return }
switch change {
case .update(let objects, let deletions, let insertions, let modifications):
Expand Down

0 comments on commit 89f2768

Please sign in to comment.