Skip to content

Commit e55ea0c

Browse files
authored
Merge pull request #2295 from LoopKit/fix_dev/ui_bolus_display
update progressCell for bolus display
2 parents f63edf9 + af109ea commit e55ea0c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Loop/View Controllers/StatusTableViewController.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)