From 5900b748be2e33902ee9be575cbce06b4e1e5d89 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 2 Nov 2020 16:27:13 -0600 Subject: [PATCH] Filter the NetNewsWire share menu item from the NetNewsWire share menu --- Mac/MainWindow/SharingServicePickerDelegate.swift | 3 ++- Multiplatform/macOS/Article/SharingServicePickerDelegate.swift | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Mac/MainWindow/SharingServicePickerDelegate.swift b/Mac/MainWindow/SharingServicePickerDelegate.swift index 1a5349a42..13c989460 100644 --- a/Mac/MainWindow/SharingServicePickerDelegate.swift +++ b/Mac/MainWindow/SharingServicePickerDelegate.swift @@ -18,7 +18,8 @@ import RSCore } func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, sharingServicesForItems items: [Any], proposedSharingServices proposedServices: [NSSharingService]) -> [NSSharingService] { - return proposedServices + SharingServicePickerDelegate.customSharingServices(for: items) + let filteredServices = proposedServices.filter { $0.menuItemTitle != "NetNewsWire" } + return filteredServices + SharingServicePickerDelegate.customSharingServices(for: items) } func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, delegateFor sharingService: NSSharingService) -> NSSharingServiceDelegate? { diff --git a/Multiplatform/macOS/Article/SharingServicePickerDelegate.swift b/Multiplatform/macOS/Article/SharingServicePickerDelegate.swift index 19ea8782c..bc6659530 100644 --- a/Multiplatform/macOS/Article/SharingServicePickerDelegate.swift +++ b/Multiplatform/macOS/Article/SharingServicePickerDelegate.swift @@ -20,7 +20,8 @@ import RSCore } func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, sharingServicesForItems items: [Any], proposedSharingServices proposedServices: [NSSharingService]) -> [NSSharingService] { - return proposedServices + SharingServicePickerDelegate.customSharingServices(for: items) + let filteredServices = proposedServices.filter { $0.menuItemTitle != "NetNewsWire" } + return filteredServices + SharingServicePickerDelegate.customSharingServices(for: items) } func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, delegateFor sharingService: NSSharingService) -> NSSharingServiceDelegate? {