mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-22 23:30:06 +01:00
Don't enable the Add button unless all conditions for an Add have been met. Fixes #2555
This commit is contained in:
parent
694bcb610f
commit
e8238c03f2
@ -96,7 +96,7 @@ class AddWebFeedWindowController : NSWindowController, AddFeedWindowController {
|
||||
return
|
||||
}
|
||||
|
||||
let container = selectedContainer()!
|
||||
guard let container = selectedContainer() else { return }
|
||||
AddWebFeedDefaultContainer.saveDefaultContainer(container)
|
||||
|
||||
delegate?.addFeedWindowController(self, userEnteredURL: url, userEnteredTitle: userEnteredTitle, container: container)
|
||||
@ -122,7 +122,7 @@ class AddWebFeedWindowController : NSWindowController, AddFeedWindowController {
|
||||
private extension AddWebFeedWindowController {
|
||||
|
||||
private func updateUI() {
|
||||
addButton.isEnabled = urlTextField.stringValue.mayBeURL
|
||||
addButton.isEnabled = urlTextField.stringValue.mayBeURL && selectedContainer() != nil
|
||||
}
|
||||
|
||||
func cancelSheet() {
|
||||
@ -130,6 +130,7 @@ private extension AddWebFeedWindowController {
|
||||
}
|
||||
|
||||
func selectedContainer() -> Container? {
|
||||
guard folderPopupButton.selectedItem?.isEnabled ?? false else { return nil }
|
||||
return folderPopupButton.selectedItem?.representedObject as? Container
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user