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:
Daniel D’Aquino
2024-01-30 07:41:42 +00:00
committed by William Casarin
parent dd240899cf
commit a6b430284f
6 changed files with 11 additions and 6 deletions

View File

@@ -688,7 +688,7 @@ struct ContentView: View {
home.damus_state = self.damus_state!
if let damus_state, damus_state.settings.enable_experimental_purple_api {
if let damus_state, damus_state.purple.enable_purple {
// Assign delegate so that we can send receipts to the Purple API server as soon as we get updates from user's purchases
StoreObserver.standard.delegate = damus_state.purple
}