From fd1f0cbe00bec16b3a112f2643dcd01ee7515838 Mon Sep 17 00:00:00 2001 From: arichorn <78001398+arichorn@users.noreply.github.com> Date: Sun, 24 Sep 2023 09:34:31 -0500 Subject: [PATCH] Fix YTNoChannelLinks Tweak --- uYouPlus.xm | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/uYouPlus.xm b/uYouPlus.xm index 5a74317..ed3a1b3 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -419,17 +419,6 @@ static BOOL didFinishLaunching; %end -// YTNoChannelLinks - crash fix for v16.42.3 -%hook _ASDisplayView -- (void)removeFromSuperview { - if ([self.accessibilityIdentifier isEqualToString:@"eml.channel_header_links"]) { - [self removeFromSuperview]; - } - - %orig; -} -%end - // YTClassicVideoQuality: https://github.com/PoomSmart/YTClassicVideoQuality %hook YTVideoQualitySwitchControllerFactory - (id)videoQualitySwitchControllerWithParentResponder:(id)responder { @@ -959,6 +948,18 @@ static void replaceTab(YTIGuideResponse *response) { if ((IsEnabled(@"hideBuySuperThanks_enabled")) && ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.suggested_action"])) { self.hidden = YES; } + +// YTNoChannelLinks - crash fix for v16.42.3 +%hook _ASDisplayView +- (void)didMoveToWindow { + %orig; + if ([self.accessibilityIdentifier isEqualToString:@"eml.channel_header_links"]) { + self.hidden = YES; + self.opaque = YES; + self.userInteractionEnabled = NO; + [self setNeedsLayout]; + [self layoutIfNeeded]; + } } %end