Skip to content

Commit

Permalink
MBL-1489: Create feature flag for PPO
Browse files Browse the repository at this point in the history
  • Loading branch information
amy-at-kickstarter committed May 29, 2024
1 parent 68afecd commit 78f3387
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Library/RemoteConfig/RemoteConfigFeature+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ public func featureLoginWithOAuthEnabled() -> Bool {
public func featureUseKeychainForOAuthTokenEnabled() -> Bool {
featureEnabled(feature: .useKeychainForOAuthToken)
}

public func featurePledgedProjectsOverviewEnabled() -> Bool {
featureEnabled(feature: .pledgedProjectsOverviewEnabled)
}
2 changes: 2 additions & 0 deletions Library/RemoteConfig/RemoteConfigFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public enum RemoteConfigFeature: String, CaseIterable {
case postCampaignPledgeEnabled = "post_campaign_pledge"
case loginWithOAuthEnabled = "ios_oauth"
case useKeychainForOAuthToken = "use_keychain_for_oauth_token"
case pledgedProjectsOverviewEnabled = "pledged_projects_overview"
}

extension RemoteConfigFeature: CustomStringConvertible {
Expand All @@ -16,6 +17,7 @@ extension RemoteConfigFeature: CustomStringConvertible {
case .postCampaignPledgeEnabled: return "Post Campaign Pledging"
case .loginWithOAuthEnabled: return "Login with OAuth"
case .useKeychainForOAuthToken: return "Use Keychain for OAuth token"
case .pledgedProjectsOverviewEnabled: return "Pledged Projects Overview"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ private func isFeatureEnabled(_ feature: RemoteConfigFeature) -> Bool {
return featureLoginWithOAuthEnabled()
case .useKeychainForOAuthToken:
return featureUseKeychainForOAuthTokenEnabled()
case .pledgedProjectsOverviewEnabled:
return featurePledgedProjectsOverviewEnabled()
}
}

Expand Down

0 comments on commit 78f3387

Please # to comment.