Disable add new item button when there are no active accounts

This commit is contained in:
Phil Viso 2019-05-19 16:08:48 -05:00
parent 438745f246
commit 90ea9ebb50
2 changed files with 4 additions and 1 deletions

View File

@ -259,6 +259,7 @@
</navigationItem>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="addNewItemButton" destination="yo6-w4-SfI" id="NbL-RH-N4J"/>
<outlet property="markAllAsReadButton" destination="ddj-Ya-Wol" id="jjr-OK-4zl"/>
</connections>
</tableViewController>

View File

@ -14,7 +14,8 @@ import RSTree
class MasterFeedViewController: ProgressTableViewController, UndoableCommandRunner {
@IBOutlet weak var markAllAsReadButton: UIBarButtonItem!
@IBOutlet private weak var markAllAsReadButton: UIBarButtonItem!
@IBOutlet private weak var addNewItemButton: UIBarButtonItem!
var undoableCommands = [UndoableCommand]()
@ -596,6 +597,7 @@ private extension MasterFeedViewController {
func updateUI() {
markAllAsReadButton.isEnabled = navState.isAnyUnreadAvailable
addNewItemButton.isEnabled = !AccountManager.shared.activeAccounts.isEmpty
}
func configureCellsForRepresentedObject(_ representedObject: AnyObject) {