diff --git a/Loop/View Controllers/StatusTableViewController.swift b/Loop/View Controllers/StatusTableViewController.swift index 9fe356cccf..4ef74b7b0d 100644 --- a/Loop/View Controllers/StatusTableViewController.swift +++ b/Loop/View Controllers/StatusTableViewController.swift @@ -298,10 +298,15 @@ final class StatusTableViewController: LoopChartsTableViewController { didSet { if oldValue != bolusState { switch bolusState { - case .inProgress(_): + case .inProgress(let dose): guard case .inProgress = oldValue else { // Bolus starting bolusProgressReporter = deviceManager.pumpManager?.createBolusProgressReporter(reportingOn: DispatchQueue.main) + // If there is an existing bolus progressCell, update its dose values now in case the app is currently in the + // background as otherwise these values won't get initialized and can contain stale data from some earlier bolus. + if let progressCell = tableView.cellForRow(at: IndexPath(row: StatusRow.status.rawValue, section: Section.status.rawValue)) as? BolusProgressTableViewCell { + progressCell.configuration = .bolusing(delivered: 0, ofTotalVolume: dose.programmedUnits) + } break } default: