Update uYouPlus.xm

This commit is contained in:
arichornlover 2024-06-22 18:51:39 -05:00 committed by GitHub
parent 641a1afbd7
commit d7333d4595
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -86,6 +86,12 @@ NSBundle *tweakBundle = uYouPlusBundle();
NSMutableArray *retVal = %orig.mutableCopy;
[self setLeadingPadding:+10];
if (self.settingsButton) {
if ([YTSessionRenderer respondsToSelector:@selector(sessionRenderer)]) {
YTSessionRenderer *sessionRenderer = [YTSessionRenderer sessionRenderer];
if ([sessionRenderer.pivots containsObject:@"FElibrary"]) { // Exclude Button from Library/You Tab (reason: it would be a duplicated button)
return retVal;
}
}
[self.settingsButton removeFromSuperview];
[self addSubview:self.settingsButton];
[retVal insertObject:self.settingsButton atIndex:0];
@ -94,12 +100,9 @@ NSBundle *tweakBundle = uYouPlusBundle();
}
%new;
- (void)settingsAction {
SettingsViewController *settingsViewController = [[SettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
UINavigationController *settingsViewControllerView = [[UINavigationController alloc] initWithRootViewController:settingsViewController];
settingsViewControllerView.modalPresentationStyle = UIModalPresentationFullScreen;
UIViewController *settingsViewController = [self _viewControllerForAncestor];
[settingsViewController presentViewController:settingsViewControllerView animated:YES completion:nil];
SettingsViewController *settingsVC = [[SettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
[settingsViewController presentViewController:settingsVC animated:YES completion:nil]
}
%end