Re-add missing youtube-native-share 0.2.3

I accidentally reverted this. It should still work as intended.
This commit is contained in:
arichornlover 2024-07-30 11:35:59 -05:00 committed by GitHub
parent d16a0ec73d
commit e91b64b248
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -171,15 +171,16 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source
YTIShareEntityEndpoint *shareEntityEndpoint = [self.command getExtension:shareEntityEndpointDescriptor];
if (!shareEntityEndpoint.hasSerializedShareEntity)
return %orig;
if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity))
if (!showNativeShareSheet(shareEntityEndpoint.serializedShareEntity, self.fromView))
return %orig;
}
%end
/* ------------------- iPhone Layout ------------------- */
%hook ELMPBShowActionSheetCommand
- (void)executeWithCommandContext:(id)_context handler:(id)_handler {
- (void)executeWithCommandContext:(ELMCommandContext*)context handler:(id)_handler {
if (!self.hasOnAppear)
return %orig;
GPBExtensionDescriptor *innertubeCommandDescriptor = [%c(YTIInnertubeCommandExtensionRoot) innertubeCommand];
@ -192,7 +193,7 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source
YTIUpdateShareSheetCommand *updateShareSheetCommand = [innertubeCommand getExtension:updateShareSheetCommandDescriptor];
if (!updateShareSheetCommand.hasSerializedShareEntity)
return %orig;
if (!showNativeShareSheet(updateShareSheetCommand.serializedShareEntity))
if (!showNativeShareSheet(updateShareSheetCommand.serializedShareEntity, context.context.fromView))
return %orig;
}
%end