Skip to content

Commit 6f3a067

Browse files
authored
[COASTAL-1251] update comparison of boluses (#580)
1 parent 3f25cbb commit 6f3a067

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Loop/View Controllers/StatusTableViewController.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,15 @@ final class StatusTableViewController: LoopChartsTableViewController {
240240
private var bolusState: PumpManagerStatus.BolusState = .noBolus {
241241
didSet {
242242
if oldValue != bolusState {
243-
// Bolus starting
244-
if case .inProgress = bolusState {
245-
bolusProgressReporter = deviceManager.pumpManager?.createBolusProgressReporter(reportingOn: DispatchQueue.main)
243+
switch bolusState {
244+
case .inProgress(_):
245+
guard case .inProgress = oldValue else {
246+
// Bolus starting
247+
bolusProgressReporter = deviceManager.pumpManager?.createBolusProgressReporter(reportingOn: DispatchQueue.main)
248+
break
249+
}
250+
default:
251+
break
246252
}
247253
refreshContext.update(with: .status)
248254
reloadData(animated: true)
@@ -785,7 +791,7 @@ final class StatusTableViewController: LoopChartsTableViewController {
785791
case (.enactingBolus, .enactingBolus):
786792
break
787793
case (.bolusing(let oldDose), .bolusing(let newDose)):
788-
if oldDose != newDose {
794+
if oldDose.syncIdentifier != newDose.syncIdentifier {
789795
tableView.reloadRows(at: [statusIndexPath], with: animated ? .fade : .none)
790796
}
791797
case (.pumpSuspended(resuming: let wasResuming), .pumpSuspended(resuming: let isResuming)):

0 commit comments

Comments
 (0)