Skip to content

Commit

Permalink
Fix AnnotationCell setup crash
Browse files Browse the repository at this point in the history
Remove unused parameter
  • Loading branch information
mvasilak committed Aug 9, 2023
1 parent a899997 commit 960e94e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ final class AnnotationViewController: UIViewController {
},
isEditable: (editability == .editable),
showsLock: (editability != .editable),
showDoneButton: false,
accessibilityType: .view,
displayName: state.displayName,
username: state.username
Expand Down Expand Up @@ -191,7 +190,6 @@ final class AnnotationViewController: UIViewController {
},
isEditable: (editability == .editable),
showsLock: (editability != .editable),
showDoneButton: false,
accessibilityType: .view,
displayName: self.viewModel.state.displayName,
username: self.viewModel.state.username
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ final class AnnotationView: UIView {
},
isEditable: (editability != .notEditable && selected),
showsLock: editability != .editable,
showDoneButton: self.layout.showDoneButton,
accessibilityType: .cell,
displayName: displayName,
username: username
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ final class AnnotationViewHeader: UIView {
author: String,
shareMenu: UIMenu?,
showsMenuButton: Bool,
showsDoneButton: Bool,
showsLock: Bool,
accessibilityType: AnnotationView.AccessibilityType
) {
Expand Down Expand Up @@ -116,7 +115,6 @@ final class AnnotationViewHeader: UIView {
shareMenuProvider: @escaping ((UIButton) -> UIMenu?),
isEditable: Bool,
showsLock: Bool,
showDoneButton: Bool,
accessibilityType: AnnotationView.AccessibilityType,
displayName: String,
username: String
Expand All @@ -130,7 +128,6 @@ final class AnnotationViewHeader: UIView {
author: author,
shareMenu: shareMenuProvider(shareButton),
showsMenuButton: isEditable,
showsDoneButton: showDoneButton,
showsLock: showsLock,
accessibilityType: accessibilityType
)
Expand Down
33 changes: 16 additions & 17 deletions Zotero/Scenes/Detail/PDF/Views/AnnotationsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -302,23 +302,22 @@ final class AnnotationsViewController: UIViewController {
preview = nil
}

if let boundingBoxConverter = self.boundingBoxConverter, let pdfAnnotationsCoordinatorDelegate = coordinatorDelegate {
cell.setup(
with: annotation,
comment: comment,
preview: preview,
selected: selected,
availableWidth: PDFReaderLayout.sidebarWidth,
library: state.library,
isEditing: state.sidebarEditingEnabled,
currentUserId: self.viewModel.state.userId,
displayName: self.viewModel.state.displayName,
username: self.viewModel.state.username,
boundingBoxConverter: boundingBoxConverter,
pdfAnnotationsCoordinatorDelegate: pdfAnnotationsCoordinatorDelegate,
state: state
)
}
guard let boundingBoxConverter = self.boundingBoxConverter, let pdfAnnotationsCoordinatorDelegate = coordinatorDelegate else { return }
cell.setup(
with: annotation,
comment: comment,
preview: preview,
selected: selected,
availableWidth: PDFReaderLayout.sidebarWidth,
library: state.library,
isEditing: state.sidebarEditingEnabled,
currentUserId: self.viewModel.state.userId,
displayName: self.viewModel.state.displayName,
username: self.viewModel.state.username,
boundingBoxConverter: boundingBoxConverter,
pdfAnnotationsCoordinatorDelegate: pdfAnnotationsCoordinatorDelegate,
state: state
)
let actionSubscription = cell.actionPublisher.subscribe(onNext: { [weak self] action in
self?.perform(action: action, annotation: annotation)
})
Expand Down

0 comments on commit 960e94e

Please sign in to comment.