Fix data desync on update.

This commit is contained in:
Hedden, Kyle Matthew 2023-12-19 12:42:11 -05:00
parent 2857b1cd55
commit b681f331ba

View File

@ -235,12 +235,11 @@ import MVMCore
formValidator = FormValidator(rules) formValidator = FormValidator(rules)
} }
// Notify the manager of new data updateUI()
manager?.newDataReceived?(in: self)
Task { @MainActor in // Notify the manager of new data.
updateUI() // Warning: Some flows cause table reloads. Until the UI update is decoupled, should be after the updateUI.
} manager?.newDataReceived?(in: self)
} }
/// Applies the latest model to the UI. /// Applies the latest model to the UI.
@ -521,7 +520,7 @@ import MVMCore
return model return model
} }
if replacedModels.count > 0 { if replacedModels.count > 0 {
Task { @MainActor in DispatchQueue.main.sync {
self.updateUI(for: replacedModels) self.updateUI(for: replacedModels)
} }
} }