Merge pull request #930 from correia/bug-921

Only enable "Open in Browser" when a single article is selected.
This commit is contained in:
Maurice Parker 2019-08-31 18:29:07 -05:00 committed by GitHub
commit fabea36a91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
} }
} }