Skip to content

Commit eb0277d

Browse files
authored
Add warning when user attempts to edit basal schedule without a configured pump (#1290)
* Add alert for unconfigured pump * Fix ordering
1 parent 298a9cc commit eb0277d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Loop/View Controllers/SettingsTableViewController.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,16 @@ final class SettingsTableViewController: UITableViewController {
521521
case .basalRate:
522522
guard let pumpManager = dataManager.pumpManager else {
523523
// Not allowing basal schedule entry without a configured pump.
524+
let alert = UIAlertController(
525+
title: NSLocalizedString("Unconfigured Pump", comment: "Alert title for unconfigured pump"),
526+
message: NSLocalizedString("Please configure a pump to view or edit scheduled basal rates.", comment: "Alert message for attempting to change basal rates before pump was configured."),
527+
preferredStyle: .alert
528+
)
529+
530+
let acknowledgeChange = UIAlertAction(title: NSLocalizedString("OK", comment: "Button text to dismiss unconfigured pump alert."), style: .default) { _ in }
531+
alert.addAction(acknowledgeChange)
532+
533+
present(alert, animated: true)
524534
tableView.deselectRow(at: indexPath, animated: true)
525535
return
526536
}

0 commit comments

Comments
 (0)