diff --git a/Shared/View Models/PreferencesViewModel.swift b/Shared/View Models/PreferencesViewModel.swift index 28dfbd8..1021e6f 100644 --- a/Shared/View Models/PreferencesViewModel.swift +++ b/Shared/View Models/PreferencesViewModel.swift @@ -4,12 +4,15 @@ import Foundation class PreferencesViewModel: ObservableObject { let handle: String + let shouldShowNotificationTypePreferences: Bool private let identityService: IdentityService init(identityService: IdentityService) { self.identityService = identityService handle = identityService.identity.handle + + shouldShowNotificationTypePreferences = identityService.identity.lastRegisteredDeviceToken != nil } } diff --git a/Shared/Views/PreferencesView.swift b/Shared/Views/PreferencesView.swift index 6bd746b..0ba2a8a 100644 --- a/Shared/Views/PreferencesView.swift +++ b/Shared/Views/PreferencesView.swift @@ -11,9 +11,11 @@ struct PreferencesView: View { NavigationLink("preferences.posting-reading", destination: PostingReadingPreferencesView( viewModel: viewModel.postingReadingPreferencesViewModel())) - NavigationLink("preferences.notification-types", - destination: NotificationTypesPreferencesView( - viewModel: viewModel.notificationTypesPreferencesViewModel())) + if viewModel.shouldShowNotificationTypePreferences { + NavigationLink("preferences.notification-types", + destination: NotificationTypesPreferencesView( + viewModel: viewModel.notificationTypesPreferencesViewModel())) + } } } .navigationTitle("preferences")