mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-27 13:54:01 +02:00
Small improvements
This commit is contained in:
@@ -18,3 +18,14 @@ extension Encodable {
|
||||
return dictionary
|
||||
}
|
||||
}
|
||||
extension DispatchQueue {
|
||||
static func runOnMainQueue(callback: @escaping (() -> Void)) {
|
||||
if Thread.isMainThread {
|
||||
callback()
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user