Skip to content

Commit

Permalink
Removed unnecessary checks
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka committed Dec 12, 2024
1 parent 28a82f4 commit ce41b1c
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,10 @@ final class PDFReaderActionHandler: ViewModelActionHandler, BackgroundDbProcessi
private func storeAnnotationPreviewsIfNeeded(isDark: Bool, in viewModel: ViewModel<PDFReaderActionHandler>) {
let libraryId = viewModel.state.library.identifier

// Load area annotations if needed.
// Load annotation previews if needed.
for (_, annotations) in viewModel.state.document.allAnnotations(of: [.square, .ink, .freeText]) {
for annotation in annotations {
guard annotation.shouldRenderPreview && annotation.isZoteroAnnotation &&
!annotationPreviewController.hasPreview(for: annotation.previewId, parentKey: viewModel.state.key, libraryId: libraryId, isDark: isDark)
else { continue }
guard !annotationPreviewController.hasPreview(for: annotation.previewId, parentKey: viewModel.state.key, libraryId: libraryId, isDark: isDark) else { continue }
annotationPreviewController.store(for: annotation, parentKey: viewModel.state.key, libraryId: libraryId, isDark: isDark)
}
}
Expand Down

0 comments on commit ce41b1c

Please sign in to comment.