Resolve some errors? (uYouPlus.xm)

This commit is contained in:
arichornlover 2023-10-19 02:31:18 -05:00 committed by GitHub
parent 15af3980f0
commit 6936a8fb2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -784,6 +784,9 @@ static void replaceTab(YTIGuideResponse *response) {
NSString *result = [[[[asCell node] accessibilityElements] valueForKey:@"description"] componentsJoinedByString:@""];
if ([cell respondsToSelector:@selector(node)]) {
NSString *idToRemove = [[cell node] accessibilityIdentifier];
// Hide the Comment Section under the Video Player (2) - @arichorn
if (IsEnabled(@"hideCommentSection_enabled") && [result rangeOfString:@"id.ui.comments_entry_point_teaser"].location != NSNotFound) {
[self deleteItemsAtIndexPaths:@[indexPath]];
@ -810,8 +813,14 @@ static void replaceTab(YTIGuideResponse *response) {
%hook _ASDisplayView
- (id)initWithElement:(ELMElement *)element {
id result = %orig;
if (IsEnabled(@"hideAddToOfflineButton_enabled") && ([element respondsToSelector:@selector(identifier)] && [[element identifier] isEqualToString:@"id.ui.add_to.offline.button"]) {
[result setHidden:YES];
if (IsEnabled(@"hideAddToOfflineButton_enabled")) {
SEL identifierSelector = NSSelectorFromString(@"identifier");
if ([element respondsToSelector:identifierSelector]) {
NSString *identifier = [element performSelector:identifierSelector];
if ([identifier isEqualToString:@"id.ui.add_to.offline.button"]) {
[result setHidden:YES];
}
}
}
return result;
}