fix: Don't show onboarding when logged in with npub

This PR makes sure to not show the onboarding screens
when a user is logged in with an npub as it doesn't
make sense for them to see that.

Changelog-Fixes: Fixes issue where onboarding views are shown to npub users

Signed-off-by: ericholguin <ericholguin@apache.org>
This commit is contained in:
ericholguin
2025-10-24 16:50:43 -06:00
committed by Daniel D’Aquino
parent 7ba2ec6713
commit 036afbf5b8

View File

@@ -306,9 +306,11 @@ struct ContentView: View {
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 || damus_state!.settings.always_show_onboarding_suggestions { if !hasSeenOnboardingSuggestions || damus_state!.settings.always_show_onboarding_suggestions {
if damus_state.is_privkey_user {
active_sheet = .onboardingSuggestions active_sheet = .onboardingSuggestions
hasSeenOnboardingSuggestions = true hasSeenOnboardingSuggestions = true
} }
}
self.appDelegate?.state = damus_state self.appDelegate?.state = damus_state
Task { // We probably don't need this to be a detached task. According to https://docs.swift.org/swift-book/documentation/the-swift-programming-language/concurrency/#Defining-and-Calling-Asynchronous-Functions, awaits are only suspension points that do not block the thread. Task { // We probably don't need this to be a detached task. According to https://docs.swift.org/swift-book/documentation/the-swift-programming-language/concurrency/#Defining-and-Calling-Asynchronous-Functions, awaits are only suspension points that do not block the thread.
await self.listenAndHandleLocalNotifications() await self.listenAndHandleLocalNotifications()