fix(ios/engine): UI-related notifications -> DispatchQueue.main

This commit is contained in:
jahorton 2020-07-23 13:51:31 +07:00
parent 485d261b83
commit 88f9bde5ee

View file

@ -615,20 +615,26 @@ public class ResourceDownloadManager {
// MARK - Notifications
internal func resourceDownloadStarted(withKey packageKey: KeymanPackage.Key) {
NotificationCenter.default.post(name: Notifications.packageDownloadStarted,
object: self,
value: packageKey)
DispatchQueue.main.async {
NotificationCenter.default.post(name: Notifications.packageDownloadStarted,
object: self,
value: packageKey)
}
}
internal func resourceDownloadCompleted(with package: KeymanPackage) {
NotificationCenter.default.post(name: Notifications.packageDownloadCompleted,
object: self,
value: package)
DispatchQueue.main.async {
NotificationCenter.default.post(name: Notifications.packageDownloadCompleted,
object: self,
value: package)
}
}
internal func resourceDownloadFailed(withKey packageKey: KeymanPackage.Key, with error: Error) {
NotificationCenter.default.post(name: Notifications.packageDownloadFailed,
object: self,
value: PackageDownloadFailedNotification(packageKey: packageKey, error: error))
DispatchQueue.main.async {
NotificationCenter.default.post(name: Notifications.packageDownloadFailed,
object: self,
value: PackageDownloadFailedNotification(packageKey: packageKey, error: error))
}
}
}