mirror of
https://github.com/cranci1/Sora.git
synced 2026-01-11 20:10:24 +00:00
fixed main thread issue
This commit is contained in:
parent
e8b3d09172
commit
7cec64fc9a
1 changed files with 3 additions and 1 deletions
|
|
@ -16,7 +16,9 @@ class HistoryManager: ObservableObject {
|
|||
init() {
|
||||
NotificationCenter.default.publisher(for: UserDefaults.didChangeNotification)
|
||||
.sink { [weak self] _ in
|
||||
self?.searchHistory = UserDefaults.standard.stringArray(forKey: "SearchHistory") ?? []
|
||||
DispatchQueue.main.async {
|
||||
self?.searchHistory = UserDefaults.standard.stringArray(forKey: "SearchHistory") ?? []
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue