Skip to content

Commit 5fbdd9b

Browse files
authored
Merge pull request #2263 from loopandlearn/fix_tidepool-merge/ui_bolus_display
update progressCell for bolus display for tidepool-merge
2 parents 438096a + 95d4a23 commit 5fbdd9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Loop/View Controllers/StatusTableViewController.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,15 @@ final class StatusTableViewController: LoopChartsTableViewController {
298298
didSet {
299299
if oldValue != bolusState {
300300
switch bolusState {
301-
case .inProgress(_):
301+
case .inProgress(let dose):
302302
guard case .inProgress = oldValue else {
303303
// Bolus starting
304304
bolusProgressReporter = deviceManager.pumpManager?.createBolusProgressReporter(reportingOn: DispatchQueue.main)
305+
// If there is an existing bolus progressCell, update its dose values now in case the app is currently in the
306+
// background as otherwise these values won't get initialized and can contain stale data from some earlier bolus.
307+
if let progressCell = tableView.cellForRow(at: IndexPath(row: StatusRow.status.rawValue, section: Section.status.rawValue)) as? BolusProgressTableViewCell {
308+
progressCell.configuration = .bolusing(delivered: 0, ofTotalVolume: dose.programmedUnits)
309+
}
305310
break
306311
}
307312
default:

0 commit comments

Comments
 (0)