Remove badge value of tab bar item when numberOfLocalCommits is zero

This commit is contained in:
Bob Sun 2017-10-10 22:15:10 -07:00
parent 0f39fa5567
commit 479453a7e3

View file

@ -500,7 +500,9 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
private func reloadTableView(data: [PasswordsTableEntry], anim: CAAnimation? = nil) { private func reloadTableView(data: [PasswordsTableEntry], anim: CAAnimation? = nil) {
// set navigation item // set navigation item
let numberOfLocalCommits = self.passwordStore.numberOfLocalCommits() let numberOfLocalCommits = self.passwordStore.numberOfLocalCommits()
if numberOfLocalCommits > 0 { if numberOfLocalCommits == 0 {
navigationController?.tabBarItem.badgeValue = nil
} else {
navigationController?.tabBarItem.badgeValue = "\(numberOfLocalCommits)" navigationController?.tabBarItem.badgeValue = "\(numberOfLocalCommits)"
} }
if parentPasswordEntity != nil { if parentPasswordEntity != nil {