Fix Notifications Tab Option (uYouPlus.xm)

It wasn’t working as intended. It should be fixed now.
This commit is contained in:
aricloverEXALT 2024-12-23 18:11:36 -06:00 committed by GitHub
parent b2e68d28a3
commit f984595077
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,29 +18,28 @@ NSBundle *tweakBundle = uYouPlusBundle();
//
// Notifications Tab - @arichornlover & @dayanch96
%group gShowNotificationsTab
%hook YTPivotBarView
- (void)setRenderer:(YTIPivotBarRenderer *)renderer {
@try {
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"kShowNotificationsTab"]) {
YTIBrowseEndpoint *endPoint = [[%c(YTIBrowseEndpoint) alloc] init];
[endPoint setBrowseId:@"FEnotifications_inbox"];
YTICommand *command = [[%c(YTICommand) alloc] init];
[command setBrowseEndpoint:endPoint];
YTIBrowseEndpoint *endPoint = [[%c(YTIBrowseEndpoint) alloc] init];
[endPoint setBrowseId:@"FEnotifications_inbox"];
YTICommand *command = [[%c(YTICommand) alloc] init];
[command setBrowseEndpoint:endPoint];
YTIPivotBarItemRenderer *itemBar = [[%c(YTIPivotBarItemRenderer) alloc] init];
[itemBar setPivotIdentifier:@"FEnotifications_inbox"];
YTIIcon *icon = [itemBar icon];
[icon setIconType:NOTIFICATIONS];
[itemBar setNavigationEndpoint:command];
YTIPivotBarItemRenderer *itemBar = [[%c(YTIPivotBarItemRenderer) alloc] init];
[itemBar setPivotIdentifier:@"FEnotifications_inbox"];
YTIIcon *icon = [itemBar icon];
[icon setIconType:YTIconTypeNOTIFICATIONS];
[itemBar setNavigationEndpoint:command];
YTIFormattedString *formatString = [%c(YTIFormattedString) formattedStringWithString:@"Notifications"];
[itemBar setTitle:formatString];
YTIFormattedString *formatString = [%c(YTIFormattedString) formattedStringWithString:@"Notifications"];
[itemBar setTitle:formatString];
YTIPivotBarSupportedRenderers *barSupport = [[%c(YTIPivotBarSupportedRenderers) alloc] init];
[barSupport setPivotBarItemRenderer:itemBar];
YTIPivotBarSupportedRenderers *barSupport = [[%c(YTIPivotBarSupportedRenderers) alloc] init];
[barSupport setPivotBarItemRenderer:itemBar];
[renderer.itemsArray addObject:barSupport];
}
[renderer.itemsArray addObject:barSupport];
} @catch (NSException *exception) {
NSLog(@"Error setting renderer: %@", exception.reason);
}
@ -66,6 +65,7 @@ NSBundle *tweakBundle = uYouPlusBundle();
}
}
%end
%end
// LEGACY VERSION ⚠️
// Hide the (Connect / Thanks / Save / Report) Buttons under the Video Player - 17.33.2 and up - @arichornlover (inspired by @PoomSmart's version)
@ -1878,6 +1878,9 @@ static int contrastMode() {
if (IS_ENABLED(kHideChipBar)) {
%init(gHideChipBar);
}
if (IS_ENABLED(kShowNotificationsTab)) {
%init(gShowNotificationsTab);
}
if (IS_ENABLED(kPortraitFullscreen)) {
%init(gPortraitFullscreen);
}