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