Fix YTNoChannelLinks Tweak

This commit is contained in:
arichorn 2023-09-24 09:34:31 -05:00 committed by GitHub
parent 5a7146710e
commit fd1f0cbe00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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