Skip to content

Commit 3baea20

Browse files
author
Rick Pasetto
authored
LOOP-3849: Remove reservoir tab in insulin delivery history if feature flag is off (#477)
* LOOP-3849: Remove reservoir tab in insulin delivery history if feature flag is off * PR Feedback
1 parent bc14ebb commit 3baea20

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Common/FeatureFlags.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ struct FeatureFlagConfiguration: Decodable {
1818
let fiaspInsulinModelEnabled: Bool
1919
let includeServicesInSettingsEnabled: Bool
2020
let manualDoseEntryEnabled: Bool
21+
let insulinDeliveryReservoirViewEnabled: Bool
2122
let mockTherapySettingsEnabled: Bool
2223
let nonlinearCarbModelEnabled: Bool
2324
let observeHealthKitSamplesFromOtherApps: Bool
@@ -83,6 +84,13 @@ struct FeatureFlagConfiguration: Decodable {
8384
self.manualDoseEntryEnabled = true
8485
#endif
8586

87+
// Swift compiler config is inverse, since the default state is enabled.
88+
#if INSULIN_DELIVERY_RESERVOIR_VIEW_DISABLED
89+
self.insulinDeliveryReservoirViewEnabled = false
90+
#else
91+
self.insulinDeliveryReservoirViewEnabled = true
92+
#endif
93+
8694
// Swift compiler config is inverse, since the default state is enabled.
8795
#if MOCK_THERAPY_SETTINGS_ENABLED
8896
self.mockTherapySettingsEnabled = true

Loop/View Controllers/InsulinDeliveryTableViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ public final class InsulinDeliveryTableViewController: UITableViewController {
9292
} else {
9393
dataSourceSegmentedControl.removeSegment(at: 2, animated: false)
9494
}
95+
if !FeatureFlags.insulinDeliveryReservoirViewEnabled {
96+
dataSourceSegmentedControl.removeSegment(at: 1, animated: false)
97+
}
9598
}
9699

97100
public override func viewWillAppear(_ animated: Bool) {

0 commit comments

Comments
 (0)