Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Do not show last loop errors in bolus view; only recommendation alerts
  • Loading branch information
ps2 committed Feb 24, 2017
commit cb394caabaf733ec2a770daacd43c54a34395f46
10 changes: 1 addition & 9 deletions Loop/View Controllers/BolusViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ final class BolusViewController: UITableViewController, IdentifiableClass, UITex

var glucoseUnit: HKUnit = HKUnit.milligramsPerDeciliterUnit()

var loopError: Error? = nil {
didSet {
updateNotice();
}
}

var bolusRecommendation: BolusRecommendation? = nil {
didSet {
let amount = bolusRecommendation?.amount ?? 0
Expand Down Expand Up @@ -243,9 +237,7 @@ final class BolusViewController: UITableViewController, IdentifiableClass, UITex
}()

private func updateNotice() {
if let error = loopError {
noticeLabel?.text = "⚠ " + error.localizedDescription
} else if let notice = bolusRecommendation?.notice {
if let notice = bolusRecommendation?.notice {
noticeLabel?.text = "⚠ " + String(describing: notice)
} else {
noticeLabel?.text = nil
Expand Down
3 changes: 1 addition & 2 deletions Loop/View Controllers/StatusTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +676,11 @@ final class StatusTableViewController: UITableViewController, UIGestureRecognize
}
}
}
self.dataManager.loopManager.getLoopStatus({ (_, _, _, _, _, iob, cob, error) in
self.dataManager.loopManager.getLoopStatus({ (_, _, _, _, _, iob, cob, _) in
DispatchQueue.main.async {
vc.glucoseUnit = self.charts.glucoseUnit
vc.activeInsulin = iob?.value
vc.activeCarbohydrates = cob?.quantity.doubleValue(for: HKUnit.gram())
vc.loopError = error
}
})

Expand Down