| | |
| | | .onReceive(NotificationCenter.default.publisher(for: .appLanguageDidChange)) { _ in |
| | | let appsSnapshot = allApps |
| | | DispatchQueue.global(qos: .userInitiated).async { |
| | | _ = AppleDefaultAppCatalog.relocalizeDefaultNotesForCurrentLanguage(apps: appsSnapshot) |
| | | _ = SmartStartService.relocalizeDefaultNotesForCurrentLanguage(apps: appsSnapshot) |
| | | DispatchQueue.main.async { |
| | | refreshApps(forceLayoutRefresh: true) |
| | |
| | | } |
| | | |
| | | private func refreshAppsForOverlay() { |
| | | guard AppIndexer.shouldRefreshForSearchPathChanges() else { return } |
| | | // Each overlay show creates a fresh ContentView with empty `allApps`. The indexer |
| | | // cache may still be warm from a prior overlay/settings scan, so path-signature |
| | | // alone must not skip the first hydrate or the grid spinner never clears. |
| | | guard allApps.isEmpty || AppIndexer.shouldRefreshForSearchPathChanges() else { return } |
| | | refreshApps() |
| | | } |
| | | |
| | | private func refreshAppsForQuickSearch() { |
| | | guard AppIndexer.shouldRefreshForSearchPathChanges() else { return } |
| | | guard allApps.isEmpty |
| | | || quickSearchDocuments.isEmpty |
| | | || AppIndexer.shouldRefreshForSearchPathChanges() |
| | | else { return } |
| | | refreshApps() |
| | | } |
| | | |