Skip to content

Commit

Permalink
use 'selectedCount' as more verbose variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Aug 11, 2024
1 parent 2cdfdb1 commit fe088c2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions deltachat-ios/Controller/ChatListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -742,18 +742,18 @@ class ChatListViewController: UITableViewController {
}

private func showDeleteMultipleChatConfirmationAlert() {
let selected = tableView.indexPathsForSelectedRows?.count ?? 0
if selected == 0 {
let selectedCount = tableView.indexPathsForSelectedRows?.count ?? 0
if selectedCount == 0 {
return
}

let message: String
if selected == 1,
if selectedCount == 1,
let chatIds = viewModel?.chatIdsFor(indexPaths: tableView.indexPathsForSelectedRows),
let chatId = chatIds.first {
message = String.localizedStringWithFormat(String.localized("ask_delete_named_chat"), dcContext.getChat(chatId: chatId).name)
} else {
message = String.localized(stringID: "ask_delete_chat", parameter: selected)
message = String.localized(stringID: "ask_delete_chat", parameter: selectedCount)
}

let alert = UIAlertController(title: nil, message: message, preferredStyle: .safeActionSheet)
Expand Down

0 comments on commit fe088c2

Please sign in to comment.