mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 04:20:07 +02:00
🐛 Fix delay due to use of async
This commit is contained in:
@ -47,21 +47,18 @@ class ServicesView: NSView, XibLoadable {
|
|||||||
|
|
||||||
override func viewWillDraw() {
|
override func viewWillDraw() {
|
||||||
super.viewWillDraw()
|
super.viewWillDraw()
|
||||||
self.loadData()
|
Task { await self.loadData() }
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func updateInformation() {
|
@objc func updateInformation() {
|
||||||
self.loadData()
|
Task { await self.loadData() }
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadData() {
|
func loadData() async {
|
||||||
|
self.applyAllInfoFieldsFromCachedValue()
|
||||||
|
let services = await HomebrewService.loadAll()
|
||||||
|
ServicesView.services = Dictionary(uniqueKeysWithValues: services.map{ ($0.name, $0) })
|
||||||
self.applyAllInfoFieldsFromCachedValue()
|
self.applyAllInfoFieldsFromCachedValue()
|
||||||
|
|
||||||
Task {
|
|
||||||
let services = await HomebrewService.loadAll()
|
|
||||||
ServicesView.services = Dictionary(uniqueKeysWithValues: services.map{ ($0.name, $0) })
|
|
||||||
self.applyAllInfoFieldsFromCachedValue()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyAllInfoFieldsFromCachedValue() {
|
func applyAllInfoFieldsFromCachedValue() {
|
||||||
|
Reference in New Issue
Block a user