Reload icons on app (un)install

This commit is contained in:
opa334 2024-01-27 01:49:53 +01:00
parent 0d5b72b19d
commit f98b2a2094
2 changed files with 16 additions and 4 deletions

View File

@ -37,8 +37,8 @@ extern NSString *LSInstallTypeKey;
@protocol LSApplicationWorkspaceObserverProtocol <NSObject>
@optional
-(void)applicationsDidInstall:(id)arg1;
-(void)applicationsDidUninstall:(id)arg1;
- (void)applicationsDidInstall:(NSArray <LSApplicationProxy *>*)apps;
- (void)applicationsDidUninstall:(NSArray <LSApplicationProxy *>*)apps;
@end
@interface LSEnumerator : NSEnumerator

View File

@ -497,13 +497,25 @@ UIImage* imageWithSize(UIImage* image, CGSize size)
[TSPresentationDelegate presentViewController:appSelectAlert animated:YES completion:nil];
}
- (void)applicationsDidInstall:(id)arg1
- (void)purgeCachedIconsForApps:(NSArray <LSApplicationProxy *>*)apps
{
for (LSApplicationProxy *appProxy in apps) {
NSString *appId = appProxy.bundleIdentifier;
if (_cachedIcons[appId]) {
[_cachedIcons removeObjectForKey:appId];
}
}
}
- (void)applicationsDidInstall:(NSArray <LSApplicationProxy *>*)apps
{
[self purgeCachedIconsForApps:apps];
[self reloadTable];
}
- (void)applicationsDidUninstall:(id)arg1
- (void)applicationsDidUninstall:(NSArray <LSApplicationProxy *>*)apps
{
[self purgeCachedIconsForApps:apps];
[self reloadTable];
}