Skip to content

Commit 3148a0c

Browse files
author
Rick Pasetto
authored
LOOP-1114: Design Review Feedback (#472)
https://tidepool.atlassian.net/browse/LOOP-1114
1 parent 5de824d commit 3148a0c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Loop/View Models/VersionUpdateViewModel.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ public class VersionUpdateViewModel: ObservableObject {
3131
}
3232
}
3333

34+
func footer(appName: String) -> String {
35+
switch versionUpdate {
36+
case .required, .recommended:
37+
return String(format: NSLocalizedString("A new version of %@ is available and is recommended to continue using the app.", comment: "Software update available section footer (1: app name)"), appName)
38+
case .available:
39+
return String(format: NSLocalizedString("A new version of %@ is available.", comment: "Required software update section footer (1: app name)"), appName)
40+
default:
41+
return ""
42+
}
43+
}
44+
3445
@ViewBuilder
3546
var softwareUpdateView: some View {
3647
supportManager?.softwareUpdateView(guidanceColors: guidanceColors)

Loop/Views/SettingsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ extension SettingsView {
101101
}
102102

103103
private var softwareUpdateSection: some View {
104-
Section(footer: Text(String(format: NSLocalizedString("A new version of %@ is available.", comment: "Software update section footer (1: app name)"), appName))) {
104+
Section(footer: Text(viewModel.versionUpdateViewModel.footer(appName: appName))) {
105105
NavigationLink(destination: viewModel.versionUpdateViewModel.softwareUpdateView) {
106106
Text(NSLocalizedString("Software Update", comment: "Software update button link text"))
107107
Spacer()

0 commit comments

Comments
 (0)