1
0
mirror of git://jb55.com/damus synced 2024-09-16 02:03:45 +00:00

Add "Always show onboarding suggestions" developer setting

This commit adds a new setting that can be used by developers to test onboarding suggestions without having to make local changes to code or reinstall the app.

Testing
-------

Device: iPhone 15 Pro (Simulator)
iOS: 17.0.1
Damus: This commit
Coverage:
1. Starting the existing app under the default setting does not show onboarding suggestions
2. Turning the setting ON causes the app to show onboarding suggestions on every app restart
3. Turning the setting back OFF causes the app to no longer show onboarding suggestions

Changelog-Added: Add "Always show onboarding suggestions" developer setting
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 2023-11-06 18:36:44 +00:00 committed by William Casarin
parent cc385d3c3f
commit b2e555284b
3 changed files with 8 additions and 1 deletions

View File

@ -299,7 +299,7 @@ struct ContentView: View {
self.connect()
try? AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default, options: .mixWithOthers)
setup_notifications()
if !hasSeenOnboardingSuggestions {
if !hasSeenOnboardingSuggestions || damus_state!.settings.always_show_onboarding_suggestions {
active_sheet = .onboardingSuggestions
hasSeenOnboardingSuggestions = true
}

View File

@ -189,6 +189,9 @@ class UserSettingsStore: ObservableObject {
@Setting(key: "developer_mode", default_value: false)
var developer_mode: Bool
@Setting(key: "always_show_onboarding_suggestions", default_value: false)
var always_show_onboarding_suggestions: Bool
@Setting(key: "emoji_reactions", default_value: default_emoji_reactions)
var emoji_reactions: [String]

View File

@ -16,6 +16,10 @@ struct DeveloperSettingsView: View {
Section(footer: Text(NSLocalizedString("Developer Mode enables features and options that may help developers diagnose issues and improve this app. Most users will not need Developer Mode.", comment: "Section header for Developer Settings view"))) {
Toggle(NSLocalizedString("Developer Mode", comment: "Setting to enable developer mode"), isOn: $settings.developer_mode)
.toggleStyle(.switch)
if settings.developer_mode {
Toggle(NSLocalizedString("Always show onboarding", comment: "Setting to always show onboarding suggestions, for developers who need to test onboarding"), isOn: $settings.always_show_onboarding_suggestions)
.toggleStyle(.switch)
}
}
}
.navigationTitle(NSLocalizedString("Developer", comment: "Navigation title for developer settings"))