mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
fixed some potential crashes
Signed-off-by: Toni Förster <toni.foerster@gmail.com>
This commit is contained in:
parent
a194738bb6
commit
bde9aade11
@ -20,10 +20,16 @@ final class Store<Data>: ResourceObserver, ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func replace(_ items: Data) {
|
func replace(_ items: Data) {
|
||||||
all = items
|
// Ensure the change happens on the main thread
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.all = items
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func clear() {
|
func clear() {
|
||||||
all = nil
|
// Ensure clearing happens on the main thread
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.all = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user