From 1583e8c556537e6afd9d980b2fa33c7130799aa7 Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Thu, 9 May 2024 18:39:28 -0500 Subject: [PATCH] =?UTF-8?q?Replace=20Alerts=20with=20YouTube=E2=80=99s=20V?= =?UTF-8?q?ersion=20(AppIconOptionsController.m)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/AppIconOptionsController.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/AppIconOptionsController.m b/Sources/AppIconOptionsController.m index 0220e40..c617c57 100644 --- a/Sources/AppIconOptionsController.m +++ b/Sources/AppIconOptionsController.m @@ -1,4 +1,5 @@ #import "AppIconOptionsController.h" +#import "uYouPlusSettings.h" #import @interface AppIconOptionsController () @@ -117,6 +118,11 @@ } - (void)saveIcon { + if (![UIApplication sharedApplication].supportsAlternateIcons) { + NSLog(@"Alternate icons are not supported on this device."); + [[%c(GOOHUDManagerInternal) sharedInstance] showMessageMainThread:[%c(YTHUDMessage) messageWithText:LOC(@"ERROR: Alternate icons are not supported on this device.")]]; + return; + } dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSString *selectedIcon = self.selectedIconIndex >= 0 ? self.appIcons[self.selectedIconIndex] : nil; if (selectedIcon) { @@ -130,7 +136,7 @@ [[UIApplication sharedApplication] setAlternateIconName:iconName completionHandler:^(NSError * _Nullable error) { if (error) { NSLog(@"Error setting alternate icon: %@", error.localizedDescription); - [self showAlertWithTitle:@"Error" message:@"Failed to set alternate icon"]; + [[%c(GOOHUDManagerInternal) sharedInstance] showMessageMainThread:[%c(YTHUDMessage) messageWithText:LOC(@"ERROR: Failed to set alternate icon")]]; } else { NSLog(@"Alternate icon set successfully"); [self showAlertWithTitle:@"Success" message:@"Alternate icon set successfully"];