This commit is contained in:
Alin
2024-04-18 11:27:04 -06:00
parent 234820bc8f
commit b8830dff5c
5 changed files with 11 additions and 11 deletions
+5
View File
@@ -374,6 +374,7 @@ func killApp(appId: String, completion: @escaping () -> Void = {}) {
// Remove app from cache
func removeApp(appState: AppState, withId id: UUID) {
@AppStorage("settings.general.brew") var brew: Bool = false
DispatchQueue.main.async {
// Remove from sortedApps if found
if let index = appState.sortedApps.firstIndex(where: { $0.id == id }) {
@@ -384,6 +385,10 @@ func removeApp(appState: AppState, withId id: UUID) {
if let index = appState.appInfoStore.firstIndex(where: { $0.id == id }) {
appState.appInfoStore.remove(at: index)
}
// Brew cleanup if enabled
if brew {
caskCleanup(app: appState.appInfo.appName)
}
}
}