We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11edd39 commit e86993fCopy full SHA for e86993f
Ice/MenuBar/MenuBarItems/MenuBarItemImageCache.swift
@@ -212,7 +212,13 @@ final class MenuBarItemImageCache: ObservableObject {
212
newImages.merge(sectionImages) { (_, new) in new }
213
}
214
215
- await MainActor.run { [newImages] in
+ // Get the set of valid item infos from all sections to clean up stale entries
216
+ let allValidInfos = await Set(appState.itemManager.itemCache.allItems.map(\.info))
217
+
218
+ await MainActor.run { [newImages, allValidInfos] in
219
+ // Remove images for items that no longer exist in the item cache
220
+ images = images.filter { allValidInfos.contains($0.key) }
221
+ // Merge in the new images
222
images.merge(newImages) { (_, new) in new }
223
224
0 commit comments