Skip to content

Commit 4f061b1

Browse files
authored
[PAL-679] divider is full width of list (#665)
* divider is full width of list * allow deleting the pump manage from debug menu
1 parent b40a368 commit 4f061b1

File tree

2 files changed

+53
-34
lines changed

2 files changed

+53
-34
lines changed

Loop/View Controllers/StatusTableViewController.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,6 +1911,12 @@ final class StatusTableViewController: LoopChartsTableViewController {
19111911
actionSheet.addAction(UIAlertAction(title: "Delete CGM Manager", style: .destructive) { _ in
19121912
self.deviceManager.cgmManager?.delete() { }
19131913
})
1914+
1915+
actionSheet.addAction(UIAlertAction(title: "Delete Pump Manager", style: .destructive) { _ in
1916+
self.deviceManager.pumpManager?.prepareForDeactivation(){ [weak self] _ in
1917+
self?.deviceManager.pumpManager?.notifyDelegateOfDeactivation() { }
1918+
}
1919+
})
19141920

19151921
actionSheet.addCancelAction()
19161922
present(actionSheet, animated: true)

Loop/Views/AlertManagementView.swift

Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -98,42 +98,55 @@ struct AlertManagementView: View {
9898
footer: !alertMuter.configuration.shouldMute ? Text(String(format: NSLocalizedString("Temporarily silence all sounds from %1$@, including sounds for Critical Alerts such as Urgent Low, Sensor Fail, Pump Expiration and others.\n\nWhile sounds are muted, alerts from %1$@ will still vibrate if haptics are enabled. Your insulin pump and CGM hardware may still sound.", comment: ""), appName, appName)) : nil
9999
) {
100100
if !alertMuter.configuration.shouldMute {
101-
Button(action: { showMuteAlertOptions = true }) {
102-
HStack(spacing: 12) {
103-
Spacer()
104-
muteAlertIcon
105-
Text(NSLocalizedString("Mute App Sounds", comment: "Label for button to mute app sounds"))
106-
.fontWeight(.semibold)
107-
Spacer()
108-
}
109-
.padding(.vertical, 6)
110-
}
111-
.actionSheet(isPresented: $showMuteAlertOptions) {
112-
muteAlertOptionsActionSheet
113-
}
101+
muteAlertsButton
114102
} else {
115-
Button(action: alertMuter.unmuteAlerts) {
116-
HStack(spacing: 12) {
117-
Spacer()
118-
unmuteAlertIcon
119-
Text(NSLocalizedString("Tap to Unmute App Sounds", comment: "Label for button to unmute all app sounds"))
120-
.fontWeight(.semibold)
121-
Spacer()
122-
}
123-
.padding(.vertical, 6)
124-
}
125-
VStack(spacing: 12) {
126-
HStack {
127-
Text(NSLocalizedString("Muted until", comment: "Label for when mute alert will end"))
128-
Spacer()
129-
Text(alertMuter.formattedEndTime)
130-
.foregroundColor(.secondary)
131-
}
132-
133-
Text("All app sounds, including sounds for Critical Alerts such as Urgent Low, Sensor Fail, and Pump Expiration will NOT sound.", comment: "Warning label that all alerts will not sound")
134-
.font(.footnote)
135-
}
103+
unmuteAlertsButton
104+
.listRowSeparator(.visible, edges: .all)
105+
muteAlertsSummary
106+
}
107+
}
108+
}
109+
110+
private var muteAlertsButton: some View {
111+
Button(action: { showMuteAlertOptions = true }) {
112+
HStack(spacing: 12) {
113+
Spacer()
114+
muteAlertIcon
115+
Text(NSLocalizedString("Mute App Sounds", comment: "Label for button to mute app sounds"))
116+
.fontWeight(.semibold)
117+
Spacer()
118+
}
119+
.padding(.vertical, 6)
120+
}
121+
.actionSheet(isPresented: $showMuteAlertOptions) {
122+
muteAlertOptionsActionSheet
123+
}
124+
}
125+
126+
private var unmuteAlertsButton: some View {
127+
Button(action: alertMuter.unmuteAlerts) {
128+
HStack(spacing: 12) {
129+
Spacer()
130+
unmuteAlertIcon
131+
Text(NSLocalizedString("Tap to Unmute App Sounds", comment: "Label for button to unmute all app sounds"))
132+
.fontWeight(.semibold)
133+
Spacer()
134+
}
135+
.padding(.vertical, 6)
136+
}
137+
}
138+
139+
private var muteAlertsSummary: some View {
140+
VStack(spacing: 12) {
141+
HStack {
142+
Text(NSLocalizedString("Muted until", comment: "Label for when mute alert will end"))
143+
Spacer()
144+
Text(alertMuter.formattedEndTime)
145+
.foregroundColor(.secondary)
136146
}
147+
148+
Text("All app sounds, including sounds for Critical Alerts such as Urgent Low, Sensor Fail, and Pump Expiration will NOT sound.", comment: "Warning label that all alerts will not sound")
149+
.font(.footnote)
137150
}
138151
}
139152

0 commit comments

Comments
 (0)