Skip to content

Commit

Permalink
multi-select is not working in search currently, we even disable it w…
Browse files Browse the repository at this point in the history
…hen entering search. so, do not allow entering search using two-finger pan gesture
  • Loading branch information
r10s committed Nov 2, 2024
1 parent de269a7 commit 51618b4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions deltachat-ios/Controller/ChatListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,14 @@ class ChatListViewController: UITableViewController {
}
}

private func canMultiSelect() -> Bool {
guard let viewModel else { return false }
return !viewModel.searchActive && !RelayHelper.shared.isForwarding()
}

private var isDuringMultipleSelectionInteraction = false
override func tableView(_ tableView: UITableView, shouldBeginMultipleSelectionInteractionAt indexPath: IndexPath) -> Bool {
true
return canMultiSelect()
}
override func tableView(_ tableView: UITableView, didBeginMultipleSelectionInteractionAt indexPath: IndexPath) {
isDuringMultipleSelectionInteraction = true
Expand Down Expand Up @@ -997,10 +1002,7 @@ extension ChatListViewController: UISearchBarDelegate {
// MARK: - ContactCellDelegate
extension ChatListViewController: ContactCellDelegate {
func onLongTap(at indexPath: IndexPath) {
if let searchActive = viewModel?.searchActive,
!searchActive,
!RelayHelper.shared.isForwarding(),
!tableView.isEditing {
if canMultiSelect() && !tableView.isEditing {
guard let chatList = viewModel?.chatList else { return }
if chatList.getChatId(index: indexPath.row) != Int(DC_CHAT_ID_ARCHIVED_LINK) {
UIImpactFeedbackGenerator(style: .medium).impactOccurred()
Expand Down

0 comments on commit 51618b4

Please sign in to comment.