diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 8c0b577..ed8cc98 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -104,7 +104,7 @@ static NSString *accessGroupID() { // Workaround: uYou 3.0.3 Adblock fix. %hook YTSectionListViewController - (void)loadWithModel:(YTISectionListRenderer *)model { - if ([@"removeYouTubeAds" boolValue]) { + if ([NSUserDefaults.standardUserDefaults boolForKey:@"removeYouTubeAds"]) { NSMutableArray *contentsArray = model.contentsArray; NSIndexSet *removeIndexes = [contentsArray indexesOfObjectsPassingTest:^BOOL(YTISectionListSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) { YTIItemSectionRenderer *sectionRenderer = renderers.itemSectionRenderer; @@ -119,7 +119,7 @@ static NSString *accessGroupID() { %hook YTWatchNextResultsViewController - (void)loadWithModel:(YTISectionListRenderer *)watchNextResults { - if ([@"removeYouTubeAds" boolValue]) { + if ([NSUserDefaults.standardUserDefaults boolForKey:@"removeYouTubeAds"]) { NSMutableArray *contentsArray = watchNextResults.contentsArray; NSIndexSet *removeIndexes = [contentsArray indexesOfObjectsPassingTest:^BOOL(YTISectionListSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) { YTIItemSectionRenderer *sectionRenderer = renderers.itemSectionRenderer;