Skip to content

Commit

Permalink
Show correct button-title (#2280)
Browse files Browse the repository at this point in the history
Back-button wasn't updated when there were no more fresh messages
  • Loading branch information
zeitschlag committed Sep 20, 2024
1 parent 1d95289 commit 6e496fa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions deltachat-ios/Controller/ChatListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ class ChatListViewController: UITableViewController {
let numberOfUnreadMessages = DcAccounts.shared.getFreshMessageCount()

if isArchive {
navigationItem.backBarButtonItem = nil
navigationItem.backButtonTitle = String.localized("chat_archived_label")
} else if numberOfUnreadMessages > 0, #available(iOS 13, *) {
let symbolName: String
Expand All @@ -256,6 +257,7 @@ class ChatListViewController: UITableViewController {

navigationItem.backBarButtonItem = UIBarButtonItem(image: UIImage(systemName: symbolName), style: .plain, target: nil, action: nil)
} else { // if numberOfUnreadMessages == 0 or iOS 12
navigationItem.backBarButtonItem = nil
navigationItem.backButtonTitle = String.localized("pref_chats")
}
}
Expand Down

0 comments on commit 6e496fa

Please sign in to comment.