Fix data desync on update.
This commit is contained in:
parent
2857b1cd55
commit
b681f331ba
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user