File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -240,10 +240,15 @@ final class StatusTableViewController: LoopChartsTableViewController {
240240 didSet {
241241 if oldValue != bolusState {
242242 switch bolusState {
243- case . inProgress( _ ) :
243+ case . inProgress( let dose ) :
244244 guard case . inProgress = oldValue else {
245245 // Bolus starting
246246 bolusProgressReporter = deviceManager. pumpManager? . createBolusProgressReporter ( reportingOn: DispatchQueue . main)
247+ // If there is an existing bolus progressCell, update its dose values now in case the app is currently in the
248+ // background as otherwise these values won't get initialized and can contain stale data from some earlier bolus.
249+ if let progressCell = tableView. cellForRow ( at: IndexPath ( row: StatusRow . status. rawValue, section: Section . status. rawValue) ) as? BolusProgressTableViewCell {
250+ progressCell. configuration = . bolusing( delivered: 0 , ofTotalVolume: dose. programmedUnits)
251+ }
247252 break
248253 }
249254 default :
You can’t perform that action at this time.
0 commit comments