Skip to content

Commit 83b0f07

Browse files
authored
Merge pull request #2312 from LoopKit/update_tidepool-merge
Update Loop tidepool-merge with improvements from dev
2 parents 947023d + 55e21a0 commit 83b0f07

9 files changed

+15
-19
lines changed

Common/Models/BuildDetails.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class BuildDetails {
1616

1717
init() {
1818
guard let url = Bundle.main.url(forResource: "BuildDetails", withExtension: ".plist"),
19-
let data = try? Data(contentsOf: url),
20-
let parsed = try? PropertyListSerialization.propertyList(from: data, format: nil) as? [String: Any] else
19+
let data = try? Data(contentsOf: url),
20+
let parsed = try? PropertyListSerialization.propertyList(from: data, format: nil) as? [String: Any] else
2121
{
2222
dict = [:]
2323
return

Loop/Managers/SupportManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ extension SupportManager: SupportUIDelegate {
220220
}
221221

222222
private var branchNameIfNotReleaseBranch: String? {
223-
return BuildDetails.default.gitBranch.filter { branch in
223+
return BuildDetails.default.workspaceGitBranch.filter { branch in
224224
return branch != "" &&
225225
branch != "main" &&
226226
branch != "master" &&

Loop/Views/BolusEntryView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ struct BolusEntryView: View {
360360
case .saveWithoutBolusing:
361361
return Text("Save without Bolusing", comment: "Button text to save carbs and/or manual glucose entry without a bolus")
362362
case .saveAndDeliver:
363-
return Text("Save and Deliver", comment: "Button text to save carbs and/or manual glucose entry and deliver a bolus")
363+
return Text("Save Carbs & Deliver", comment: "Button text to save carbs and/or manual glucose entry and deliver a bolus")
364364
case .enterBolus:
365365
return Text("Enter Bolus", comment: "Button text to begin entering a bolus")
366366
case .deliver:

Loop/Views/GlucoseBasedApplicationFactorSelectionView.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ public struct GlucoseBasedApplicationFactorSelectionView: View {
4444
}
4545
}
4646
.padding()
47-
.onChange(of: isGlucoseBasedApplicationFactorEnabled) { newValue in
48-
UserDefaults.standard.glucoseBasedApplicationFactorEnabled = newValue
49-
}
5047
}
5148
.navigationBarTitleDisplayMode(.inline)
5249
}

Loop/Views/IntegralRetrospectiveCorrectionSelectionView.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ public struct IntegralRetrospectiveCorrectionSelectionView: View {
2727
Divider()
2828

2929
Toggle(NSLocalizedString("Enable Integral Retrospective Correction", comment: "Title for Integral Retrospective Correction toggle"), isOn: $isIntegralRetrospectiveCorrectionEnabled)
30-
.onChange(of: isIntegralRetrospectiveCorrectionEnabled) { newValue in
31-
UserDefaults.standard.integralRetrospectiveCorrectionEnabled = newValue
32-
}
3330
.padding(.top, 20)
3431
}
3532
.padding()

Loop/Views/SettingsView+algorithmExperimentsSection.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public struct ExperimentRow: View {
3939
}
4040

4141
public struct ExperimentsSettingsView: View {
42-
@State private var isGlucoseBasedApplicationFactorEnabled = UserDefaults.standard.glucoseBasedApplicationFactorEnabled
43-
@State private var isIntegralRetrospectiveCorrectionEnabled = UserDefaults.standard.integralRetrospectiveCorrectionEnabled
42+
@AppStorage(UserDefaults.Key.GlucoseBasedApplicationFactorEnabled.rawValue) private var isGlucoseBasedApplicationFactorEnabled = false
43+
@AppStorage(UserDefaults.Key.IntegralRetrospectiveCorrectionEnabled.rawValue) private var isIntegralRetrospectiveCorrectionEnabled = false
4444
var automaticDosingStrategy: AutomaticDosingStrategy
4545

4646
public var body: some View {
@@ -80,7 +80,7 @@ public struct ExperimentsSettingsView: View {
8080

8181

8282
extension UserDefaults {
83-
private enum Key: String {
83+
fileprivate enum Key: String {
8484
case GlucoseBasedApplicationFactorEnabled = "com.loopkit.algorithmExperiments.glucoseBasedApplicationFactorEnabled"
8585
case IntegralRetrospectiveCorrectionEnabled = "com.loopkit.algorithmExperiments.integralRetrospectiveCorrectionEnabled"
8686
}

Loop/Views/SimpleBolusView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ struct SimpleBolusView: View {
256256
case .saveWithoutBolusing:
257257
return Text("Save without Bolusing", comment: "Button text to save carbs and/or manual glucose entry without a bolus")
258258
case .saveAndDeliver:
259-
return Text("Save and Deliver", comment: "Button text to save carbs and/or manual glucose entry and deliver a bolus")
259+
return Text("Save Carbs & Deliver", comment: "Button text to save carbs and/or manual glucose entry and deliver a bolus")
260260
case .enterBolus:
261261
return Text("Enter Bolus", comment: "Button text to begin entering a bolus")
262262
case .deliver:

Version.xcconfig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
// Copyright © 2020 LoopKit Authors. All rights reserved.
77
//
88

9-
// Version [DEFAULT]
10-
LOOP_MARKETING_VERSION = 3.5.0
11-
CURRENT_PROJECT_VERSION = 57
9+
// Version
10+
// [for DIY Loop] configure the version number in LoopWorkspace
11+
LOOP_MARKETING_VERSION = 1.0
12+
CURRENT_PROJECT_VERSION = 1
1213

13-
// Optional override
14+
// Optional override (enables override of version)
15+
#include? "../VersionOverride.xcconfig"
1416
#include? "VersionOverride.xcconfig"

WatchApp Extension/View Models/CarbAndBolusFlowViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ final class CarbAndBolusFlowViewModel: ObservableObject {
117117
date: lastEntryDate,
118118
quantity: HKQuantity(unit: .gram(), doubleValue: Double(grams)),
119119
startDate: carbEntryDate,
120-
foodType: nil,
120+
foodType: carbAbsorptionTime.emoji,
121121
absorptionTime: absorptionTime(for: carbAbsorptionTime)
122122
)
123123

0 commit comments

Comments
 (0)