From af082215e29b7e22279c1131a1ff766bfe8275ac Mon Sep 17 00:00:00 2001 From: Foxster Date: Fri, 26 Jan 2024 20:01:47 -0800 Subject: [PATCH] Fix hide iSponsorBlock option --- Sources/uYouPlus.h | 5 +++++ Sources/uYouPlus.xm | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index 0e470aa..3d13808 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -28,6 +28,11 @@ - (void)confirmAlertDidPressConfirm; @end +// Hide iSponsorBlock +@interface YTRightNavigationButtons : UIView +@property (nonatomic, readwrite, strong) UIView *sponsorBlockButton; +@end + // Hide YouTube annoying banner in Home page? - @MiRO92 - YTNoShorts: https://github.com/MiRO92/YTNoShorts @interface _ASCollectionViewCell : UICollectionViewCell - (id)node; diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 2af91de..5dd5b70 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -157,10 +157,10 @@ NSBundle *tweakBundle = uYouPlusBundle(); // Hide iSponsorBlock %hook YTRightNavigationButtons -- (void)setSponsorBlockButton:(id)sponsorBlockButton { - if (IS_ENABLED(@"hideiSponsorBlockButton_enabled")) - return; +- (void)layoutSubviews { %orig; + if (IS_ENABLED(@"hideiSponsorBlockButton_enabled")) + self.sponsorBlockButton.hidden = YES; } %end