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)
}
// Notify the manager of new data
manager?.newDataReceived?(in: self)
updateUI()
Task { @MainActor in
updateUI()
}
// Notify the manager of new data.
// 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.
@ -521,7 +520,7 @@ import MVMCore
return model
}
if replacedModels.count > 0 {
Task { @MainActor in
DispatchQueue.main.sync {
self.updateUI(for: replacedModels)
}
}