Rename activeProfileId publisher for consistency
This commit is contained in:
parent
cbf00cef73
commit
9d9dc2b2f6
|
@ -31,10 +31,10 @@ public protocol ProfileManager {
|
|||
|
||||
var activeProfileId: UUID? { get }
|
||||
|
||||
var activeProfileIdPublisher: Published<UUID?>.Publisher { get }
|
||||
|
||||
var currentProfileId: UUID? { get set }
|
||||
|
||||
var didUpdateActiveProfile: PassthroughSubject<UUID?, Never> { get }
|
||||
|
||||
var didCreateProfile: PassthroughSubject<Profile, Never> { get }
|
||||
|
||||
var headers: [Profile.Header] { get }
|
||||
|
|
|
@ -60,10 +60,6 @@ public class DefaultProfileManager: ProfileManagerWithCurrentProfile, Observable
|
|||
}
|
||||
}
|
||||
|
||||
public var activeProfileIdPublisher: Published<UUID?>.Publisher {
|
||||
$internalActiveProfileId
|
||||
}
|
||||
|
||||
public var currentProfileId: UUID? {
|
||||
get {
|
||||
internalCurrentProfileId
|
||||
|
@ -83,6 +79,8 @@ public class DefaultProfileManager: ProfileManagerWithCurrentProfile, Observable
|
|||
|
||||
public let currentProfile: ObservableProfile
|
||||
|
||||
public let didUpdateActiveProfile = PassthroughSubject<UUID?, Never>()
|
||||
|
||||
public let didCreateProfile = PassthroughSubject<Profile, Never>()
|
||||
|
||||
private var cancellables: Set<AnyCancellable> = []
|
||||
|
@ -293,6 +291,11 @@ extension DefaultProfileManager {
|
|||
|
||||
extension DefaultProfileManager {
|
||||
public func observeUpdates() {
|
||||
$internalActiveProfileId
|
||||
.sink {
|
||||
self.didUpdateActiveProfile.send($0)
|
||||
}.store(in: &cancellables)
|
||||
|
||||
strategy.willUpdateProfiles()
|
||||
.dropFirst()
|
||||
.sink {
|
||||
|
|
|
@ -159,7 +159,7 @@ extension DefaultVPNManager {
|
|||
}
|
||||
|
||||
private func observeProfileManager() {
|
||||
profileManager.activeProfileIdPublisher
|
||||
profileManager.didUpdateActiveProfile
|
||||
.dropFirst()
|
||||
.removeDuplicates()
|
||||
.sink { newId in
|
||||
|
|
Loading…
Reference in New Issue