diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index a91b37df..c8914790 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -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) } }