Skip to content

Commit

Permalink
Fix items deselection (#1054)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvasilak authored Jan 14, 2025
1 parent 79f7243 commit f3eddec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Zotero/Scenes/Detail/Items/Views/ItemsTableViewHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ protocol ItemsTableViewHandlerDelegate: AnyObject {
var isInViewHierarchy: Bool { get }
var collectionKey: String? { get }
var library: Library { get }
var isEditing: Bool { get }

func process(action: ItemAction.Kind, at index: Int, completionAction: ((Bool) -> Void)?)
func process(tapAction action: ItemsTableViewHandler.TapAction)
Expand Down Expand Up @@ -84,7 +83,7 @@ final class ItemsTableViewHandler: NSObject {
}

func attachmentAccessoriesChanged() {
if delegate.isEditing && !dataSource.selectedItems.isEmpty {
if tableView.isEditing, !dataSource.selectedItems.isEmpty {
// Accessories changed by user, reload only selected items
reloadSelected()
} else {
Expand Down Expand Up @@ -281,7 +280,7 @@ extension ItemsTableViewHandler: UITableViewDelegate {
}

func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
guard delegate.isEditing, let object = dataSource.object(at: indexPath.row) else { return }
guard tableView.isEditing, let object = dataSource.object(at: indexPath.row) else { return }
delegate.process(tapAction: .deselectItem(object))
}

Expand Down

0 comments on commit f3eddec

Please sign in to comment.