Only enable "Open in Browser" when a single article is selected.

Fixes bug #921.
This commit is contained in:
Jim Correia 2019-08-31 15:46:15 -07:00
parent c1216bf7bb
commit cdfdc06142
1 changed files with 6 additions and 0 deletions

View File

@ -684,9 +684,15 @@ extension TimelineViewController: NSUserInterfaceValidations {
func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool { func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
if item.action == #selector(openArticleInBrowser(_:)) {
let currentLink = oneSelectedArticle?.preferredLink
return currentLink != nil
}
if item.action == #selector(copy(_:)) { if item.action == #selector(copy(_:)) {
return NSPasteboard.general.canCopyAtLeastOneObject(selectedArticles) return NSPasteboard.general.canCopyAtLeastOneObject(selectedArticles)
} }
return true return true
} }
} }