Some fixes

- Import remote profiles off the main thread
- Drop meaningless Published
- Add a FIXME to move Profile build logic to library
This commit is contained in:
Davide 2024-10-15 23:37:50 +02:00
parent 8cdd20dfb4
commit aeaf0a6eed
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
3 changed files with 1 additions and 2 deletions

View File

@ -254,7 +254,6 @@ extension ProfileManager {
remoteRepository? remoteRepository?
.profilesPublisher .profilesPublisher
.dropFirst() .dropFirst()
.receive(on: DispatchQueue.main)
.sink { [weak self] in .sink { [weak self] in
self?.importRemoteProfiles($0) self?.importRemoteProfiles($0)
} }

View File

@ -33,7 +33,6 @@ final class InteractiveManager: ObservableObject {
@Published @Published
var isPresented = false var isPresented = false
@Published
private(set) var editor = ProfileEditor() private(set) var editor = ProfileEditor()
private var onComplete: CompletionBlock? private var onComplete: CompletionBlock?

View File

@ -98,6 +98,7 @@ private extension EditableProfile {
} }
} }
// FIXME: ###, move to library
func checkConstraints() throws { func checkConstraints() throws {
if activeConnectionModule == nil, if activeConnectionModule == nil,
let ipModule = modules.first(where: { activeModulesIds.contains($0.id) && $0 is IPModule.Builder }) { let ipModule = modules.first(where: { activeModulesIds.contains($0.id) && $0 is IPModule.Builder }) {