Observe passwordStoreUpdated notification in CommitLogs controller
This commit is contained in:
parent
eccfeb19b5
commit
d94c7626a6
1 changed files with 6 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ class CommitLogsTableViewController: UITableViewController {
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
NotificationCenter.default.addObserver(self, selector: #selector(updateCommitLogs), name: .passwordStoreUpdated, object: nil)
|
||||||
commits = passwordStore.getRecentCommits(count: 20)
|
commits = passwordStore.getRecentCommits(count: 20)
|
||||||
self.tableView.estimatedRowHeight = 50
|
self.tableView.estimatedRowHeight = 50
|
||||||
self.tableView.rowHeight = UITableViewAutomaticDimension
|
self.tableView.rowHeight = UITableViewAutomaticDimension
|
||||||
|
|
@ -39,4 +40,9 @@ class CommitLogsTableViewController: UITableViewController {
|
||||||
messageLabel?.text = commits[indexPath.row].message?.trimmingCharacters(in: .whitespacesAndNewlines)
|
messageLabel?.text = commits[indexPath.row].message?.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func updateCommitLogs () {
|
||||||
|
commits = passwordStore.getRecentCommits(count: 20)
|
||||||
|
tableView.reloadData()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue