Update uYouPlusSettings.xm

This commit is contained in:
aricloverGitHub (INACTIVE) 2024-12-04 18:40:27 -06:00 committed by GitHub
parent fdd0923395
commit a29c6c09b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -330,26 +330,16 @@ extern NSBundle *uYouPlusBundle();
]; ];
[sectionItems addObject:appIcon]; [sectionItems addObject:appIcon];
YTSettingsSectionItem *clearCache = [%c(YTSettingsSectionItem) [%c(YTSettingsSectionItem) itemWithTitle:@"Clear Cache" titleDescription:nil accessibilityIdentifier:nil detailTextBlock:^NSString *() { return GetCacheSize(); } selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
itemWithTitle:LOC(@"ClearCache") dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
titleDescription:nil NSString *cachePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject;
accessibilityIdentifier:@"YTLiteSectionItem" [[NSFileManager defaultManager] removeItemAtPath:cachePath error:nil];
detailTextBlock:^NSString *() { });
return GetCacheSize();
} [[%c(YTToastResponderEvent) eventWithMessage:LOC(@"Done") firstResponder:[self parentResponder]] send];
selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ return YES;
NSString *cachePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES).firstObject; }],
[[NSFileManager defaultManager] removeItemAtPath:cachePath error:nil];
dispatch_async(dispatch_get_main_queue(), ^{
cell.detailTextLabel.text = GetCacheSize();
[settingsViewController showToastWithMessage:LOC(@"Done")];
});
});
return YES;
}
];
[sectionItems addObject:clearCache];
YTSettingsSectionItem *clearNotifications = [%c(YTSettingsSectionItem) YTSettingsSectionItem *clearNotifications = [%c(YTSettingsSectionItem)
itemWithTitle:LOC(@"CLEAR_NOTIFICATIONS") itemWithTitle:LOC(@"CLEAR_NOTIFICATIONS")