This commit is contained in:
Alin
2024-09-30 11:20:11 -06:00
parent d8f650116c
commit dbcf0ba655
9 changed files with 149 additions and 145 deletions
+2 -10
View File
@@ -156,16 +156,8 @@ struct AppListItems: View {
}
.onAppear {
if self.bundleSize == 0 {
DispatchQueue.global(qos: .userInitiated).async {
let size = totalSizeOnDisk(for: appInfo.path).logical
DispatchQueue.main.async {
print("Sizing up")
self.bundleSize = size
// Update the appInfo in the appState array
if let index = appState.sortedApps.firstIndex(where: { $0.path == appInfo.path }) {
appState.sortedApps[index].bundleSize = size
}
}
appState.getBundleSize(for: appInfo) { size in
self.bundleSize = size
}
}
}