Skip to content

Commit c72714f

Browse files
committed
[LOOP-4483] Study Product Selection
1 parent 0ce27cd commit c72714f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Loop/Managers/OnboardingManager.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ extension OnboardingManager: TherapySettingsProvider {
435435

436436
extension OnboardingManager: OnboardingProvider {
437437
var allowDebugFeatures: Bool { FeatureFlags.allowDebugFeatures } // NOTE: DEBUG FEATURES - DEBUG AND TEST ONLY
438+
var studyProductSelection: StudyProduct { StudyProduct(rawValue: UserDefaults.appGroup?.studyProductSelection ?? "none") ?? .none }
438439
}
439440

440441
// MARK: - OnboardingUI

LoopCore/NSUserDefaults.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ extension UserDefaults {
2020
case lastProfileExpirationAlertDate = "com.loopkit.Loop.lastProfileExpirationAlertDate"
2121
case allowDebugFeatures = "com.loopkit.Loop.allowDebugFeatures"
2222
case allowSimulators = "com.loopkit.Loop.allowSimulators"
23+
case studyProductSelection = "com.loopkit.Loop.studyProductSelection"
2324
case resetLoop = "com.loopkit.Loop.resetLoop"
2425
}
2526

@@ -128,6 +129,15 @@ extension UserDefaults {
128129
return bool(forKey: Key.allowSimulators.rawValue)
129130
}
130131

132+
public var studyProductSelection: String? {
133+
get {
134+
string(forKey: Key.studyProductSelection.rawValue)
135+
}
136+
set {
137+
set(newValue, forKey: Key.studyProductSelection.rawValue)
138+
}
139+
}
140+
131141
public var resetLoop: Bool {
132142
get {
133143
bool(forKey: Key.resetLoop.rawValue)

0 commit comments

Comments
 (0)