mirror of
git://jb55.com/damus
synced 2024-09-18 19:23:49 +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:
parent
cc385d3c3f
commit
b2e555284b
@ -299,7 +299,7 @@ struct ContentView: View {
|
|||||||
self.connect()
|
self.connect()
|
||||||
try? AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default, options: .mixWithOthers)
|
try? AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback, mode: .default, options: .mixWithOthers)
|
||||||
setup_notifications()
|
setup_notifications()
|
||||||
if !hasSeenOnboardingSuggestions {
|
if !hasSeenOnboardingSuggestions || damus_state!.settings.always_show_onboarding_suggestions {
|
||||||
active_sheet = .onboardingSuggestions
|
active_sheet = .onboardingSuggestions
|
||||||
hasSeenOnboardingSuggestions = true
|
hasSeenOnboardingSuggestions = true
|
||||||
}
|
}
|
||||||
|
@ -189,6 +189,9 @@ class UserSettingsStore: ObservableObject {
|
|||||||
@Setting(key: "developer_mode", default_value: false)
|
@Setting(key: "developer_mode", default_value: false)
|
||||||
var developer_mode: Bool
|
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)
|
@Setting(key: "emoji_reactions", default_value: default_emoji_reactions)
|
||||||
var emoji_reactions: [String]
|
var emoji_reactions: [String]
|
||||||
|
|
||||||
|
@ -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"))) {
|
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)
|
Toggle(NSLocalizedString("Developer Mode", comment: "Setting to enable developer mode"), isOn: $settings.developer_mode)
|
||||||
.toggleStyle(.switch)
|
.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"))
|
.navigationTitle(NSLocalizedString("Developer", comment: "Navigation title for developer settings"))
|
||||||
|
Loading…
Reference in New Issue
Block a user