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