|
|
@@ -187,11 +187,15 @@ extension Adjustments.StateModel {
|
|
|
/// Then unpack it on the view context and update the State variables which can be used on in the View for some Logic
|
|
|
/// This also needs to be called when we cancel an Override via the Home View to update the State of the Button for this case
|
|
|
func updateLatestOverrideConfiguration() {
|
|
|
- Task {
|
|
|
- let id = await overrideStorage.loadLatestOverrideConfigurations(fetchLimit: 1)
|
|
|
- async let updateState: () = updateLatestOverrideConfigurationOfState(from: id)
|
|
|
- async let setOverride: () = setCurrentOverride(from: id)
|
|
|
- _ = await (updateState, setOverride)
|
|
|
+ Task { [weak self] in
|
|
|
+ guard let self = self else { return }
|
|
|
+
|
|
|
+ let id = await self.overrideStorage.loadLatestOverrideConfigurations(fetchLimit: 1)
|
|
|
+
|
|
|
+ // execute sequentially instead of concurrently
|
|
|
+ await self.updateLatestOverrideConfigurationOfState(from: id)
|
|
|
+ await self.setCurrentOverride(from: id)
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|