mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-25 19:10:49 +02:00
Update logic for thread list bar button item
This commit is contained in:
@@ -50,6 +50,13 @@ class BadgedBarButtonItem: UIBarButtonItem {
|
||||
}
|
||||
}
|
||||
|
||||
private var shouldHideBadge: Bool {
|
||||
guard let text = badgeText else {
|
||||
return true
|
||||
}
|
||||
return text.isEmpty || text == "0" || text == "nil" || text == "null"
|
||||
}
|
||||
|
||||
init(withBaseButton baseButton: UIButton) {
|
||||
self.baseButton = baseButton
|
||||
badgeBackgroundColor = .gray
|
||||
@@ -71,6 +78,7 @@ class BadgedBarButtonItem: UIBarButtonItem {
|
||||
}
|
||||
|
||||
private func updateBadgeLabel() {
|
||||
badgeLabel.isHidden = shouldHideBadge
|
||||
badgeLabel.backgroundColor = badgeBackgroundColor
|
||||
badgeLabel.font = badgeFont
|
||||
badgeLabel.textColor = badgeTextColor
|
||||
|
||||
Reference in New Issue
Block a user