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
@@ -20,13 +20,13 @@ struct TranslationSettingsView: View {
|
||||
.toggleStyle(.switch)
|
||||
|
||||
Picker(NSLocalizedString("Service", comment: "Prompt selection of translation service provider."), selection: $settings.translation_service) {
|
||||
ForEach(TranslationService.allCases.filter({ settings.enable_experimental_purple_api ? true : $0 != .purple }), id: \.self) { server in
|
||||
ForEach(TranslationService.allCases.filter({ damus_state.purple.enable_purple ? true : $0 != .purple }), id: \.self) { server in
|
||||
Text(server.model.displayName)
|
||||
.tag(server.model.tag)
|
||||
}
|
||||
}
|
||||
|
||||
if settings.translation_service == .purple && settings.enable_experimental_purple_api {
|
||||
if settings.translation_service == .purple && damus_state.purple.enable_purple {
|
||||
NavigationLink(destination: DamusPurpleView(damus_state: damus_state)) {
|
||||
Text(NSLocalizedString("Configure Damus Purple", comment: "Button to allow Damus Purple to be configured"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user