Skip to content

Commit 198b081

Browse files
committed
Hide feature behind the feature flag
1 parent e266690 commit 198b081

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Analytics Hub/Time Range/AnalyticsHubTimeRangeSelection.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,19 @@ extension AnalyticsHubTimeRangeSelection {
8181
/// Wee need to provide a custom `allCases` because the `.custom(Date?, Date?)`case disables its synthetization.
8282
///
8383
static var allCases: [AnalyticsHubTimeRangeSelection.SelectionType] {
84-
[.custom(start: nil, end: nil), .today, .yesterday, .lastWeek, .lastMonth, .lastQuarter, .lastYear, .weekToDate, .monthToDate, .quarterToDate,
85-
.yearToDate]
84+
[
85+
ServiceLocator.featureFlagService.isFeatureFlagEnabled(.analyticsHub) ? .custom(start: nil, end: nil) : nil,
86+
.today,
87+
.yesterday,
88+
.lastWeek,
89+
.lastMonth,
90+
.lastQuarter,
91+
.lastYear,
92+
.weekToDate,
93+
.monthToDate,
94+
.quarterToDate,
95+
yearToDate
96+
].compactMap { $0 }
8697
}
8798

8899
// When adding a new case, remember to add it to `allCases`.

0 commit comments

Comments
 (0)