parent
008b78cc7c
commit
1b9b9cbd5c
|
@ -352,7 +352,7 @@ extension ProfileManager {
|
||||||
|
|
||||||
let newRepository = remoteRepositoryBlock(isRemoteImportingEnabled)
|
let newRepository = remoteRepositoryBlock(isRemoteImportingEnabled)
|
||||||
let initialProfiles = try await newRepository.fetchProfiles()
|
let initialProfiles = try await newRepository.fetchProfiles()
|
||||||
reloadRemoteProfiles(initialProfiles, importing: false)
|
reloadRemoteProfiles(initialProfiles)
|
||||||
remoteRepository = newRepository
|
remoteRepository = newRepository
|
||||||
|
|
||||||
remoteRepository?
|
remoteRepository?
|
||||||
|
@ -360,7 +360,7 @@ extension ProfileManager {
|
||||||
.dropFirst()
|
.dropFirst()
|
||||||
.receive(on: DispatchQueue.main)
|
.receive(on: DispatchQueue.main)
|
||||||
.sink { [weak self] in
|
.sink { [weak self] in
|
||||||
self?.reloadRemoteProfiles($0, importing: true)
|
self?.reloadRemoteProfiles($0)
|
||||||
}
|
}
|
||||||
.store(in: &remoteSubscriptions)
|
.store(in: &remoteSubscriptions)
|
||||||
}
|
}
|
||||||
|
@ -393,7 +393,7 @@ private extension ProfileManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func reloadRemoteProfiles(_ result: [Profile], importing: Bool) {
|
func reloadRemoteProfiles(_ result: [Profile]) {
|
||||||
pp_log(.App.profiles, .info, "Reload remote profiles: \(result.map(\.id))")
|
pp_log(.App.profiles, .info, "Reload remote profiles: \(result.map(\.id))")
|
||||||
allRemoteProfiles = result.reduce(into: [:]) {
|
allRemoteProfiles = result.reduce(into: [:]) {
|
||||||
$0[$1.id] = $1
|
$0[$1.id] = $1
|
||||||
|
@ -402,10 +402,6 @@ private extension ProfileManager {
|
||||||
waitingObservers.remove(.remote)
|
waitingObservers.remove(.remote)
|
||||||
}
|
}
|
||||||
|
|
||||||
guard importing else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Task.detached { [weak self] in
|
Task.detached { [weak self] in
|
||||||
guard let self else {
|
guard let self else {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue