From 7a4edbec64c7c29d10787f7efbde6c5e85caaf35 Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Mon, 24 Jun 2024 05:50:10 -0500 Subject: [PATCH] Updated iPad version of ytns (experimental) --- Sources/uYouPlusPatches.xm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sources/uYouPlusPatches.xm b/Sources/uYouPlusPatches.xm index 37f3947..53812dd 100644 --- a/Sources/uYouPlusPatches.xm +++ b/Sources/uYouPlusPatches.xm @@ -159,12 +159,14 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity) { - (BOOL)handleCommand:(id)command entry:(id)_entry fromView:(id)_fromView sender:(id)_sender completionBlock:(id)_completionBlock { GPBExtensionDescriptor *shareEntityEndpointDescriptor = [%c(YTIShareEntityEndpoint) shareEntityEndpoint]; if (![command hasExtension:shareEntityEndpointDescriptor]) + return %orig; + YTIShareEntityEndpoint *shareEntityEndpoint = [command getExtension:shareEntityEndpointDescriptor]; + if(!shareEntityEndpoint || !shareEntityEndpoint.hasSerializedShareEntity || !shareEntityEndpoint.serializedShareEntity) { return %orig; - YTIShareEntityEndpoint *shareEntityEndpoint = [command getExtension:shareEntityEndpointDescriptor]; - if(!shareEntityEndpoint.hasSerializedShareEntity) - return %orig; - if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity)) + } + if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity)) { return %orig; + } return TRUE; } %end