mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 16:21:00 +00:00
31 lines
1,003 B
Swift
31 lines
1,003 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
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
|
|
}
|
|
}
|
|
|
|
extension PreferencesViewModel {
|
|
func postingReadingPreferencesViewModel() -> PostingReadingPreferencesViewModel {
|
|
PostingReadingPreferencesViewModel(identityService: identityService)
|
|
}
|
|
|
|
func notificationTypesPreferencesViewModel() -> NotificationTypesPreferencesViewModel {
|
|
NotificationTypesPreferencesViewModel(identityService: identityService)
|
|
}
|
|
|
|
func filtersViewModel() -> FiltersViewModel {
|
|
FiltersViewModel(identityService: identityService)
|
|
}
|
|
}
|