@@ -209,6 +209,8 @@ final class BolusEntryViewModel: ObservableObject {
209209 self . dosingDecision. originalCarbEntry = originalCarbEntry
210210
211211 self . cachedDisplayGlucoseUnit = delegate. displayGlucoseUnitObservable. displayGlucoseUnit
212+
213+ self . updateSettings ( )
212214 }
213215
214216 public func generateRecommendationAndStartObserving( _ completion: ( ( ) -> Void ) ? = nil ) {
@@ -226,7 +228,13 @@ final class BolusEntryViewModel: ObservableObject {
226228 NotificationCenter . default
227229 . publisher ( for: . LoopDataUpdated)
228230 . receive ( on: DispatchQueue . main)
229- . sink { [ weak self] _ in
231+ . sink { [ weak self] note in
232+ if let rawContext = note. userInfo ? [ LoopDataManager . LoopUpdateContextKey] as? LoopDataManager . LoopUpdateContext . RawValue ,
233+ let context = LoopDataManager . LoopUpdateContext ( rawValue: rawContext) ,
234+ context == . preferences
235+ {
236+ self ? . updateSettings ( )
237+ }
230238 self ? . update ( )
231239 }
232240 . store ( in: & cancellables)
@@ -621,9 +629,6 @@ final class BolusEntryViewModel: ObservableObject {
621629 }
622630 delegate. withLoopState { [ weak self] state in
623631 self ? . updateCarbsOnBoard ( from: state)
624- DispatchQueue . main. async {
625- self ? . updateSettings ( )
626- }
627632 self ? . updateRecommendedBolusAndNotice ( from: state, isUpdatingFromUserInput: false )
628633 self ? . updatePredictedGlucoseValues ( from: state)
629634 DispatchQueue . main. async {
0 commit comments