purple: feature flag management
Originally the Damus Purple feature was gated behind a setting which served as a feature flag. However, when we release, we need to enable Purple features for all users running on a particular version. This commit improves feature flag management by replacing the setting with a computed property (which still points to the setting, but can be very easily replaced) Signed-off-by: Daniel D’Aquino <daniel@daquino.me> Reviewed-by: William Casarin <jb55@jb55.com> Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
William Casarin
parent
dd240899cf
commit
a6b430284f
@@ -26,6 +26,11 @@ class DamusPurple: StoreObserverDelegate {
|
||||
var environment: DamusPurpleEnvironment {
|
||||
return self.settings.purple_enviroment
|
||||
}
|
||||
|
||||
var enable_purple: Bool {
|
||||
// TODO: On release, we could just replace this with `true` (or some other feature flag)
|
||||
return self.settings.enable_experimental_purple_api
|
||||
}
|
||||
|
||||
func profile_purple_badge_info(pubkey: Pubkey) async -> UserBadgeInfo? {
|
||||
if let cached_result = self.starred_profiles_cache[pubkey] {
|
||||
|
||||
Reference in New Issue
Block a user