Do not import remote profiles on first load

This commit is contained in:
Davide De Rosa 2024-10-04 15:50:45 +02:00
parent eea5486563
commit 671dc7f77c
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
1 changed files with 6 additions and 0 deletions

View File

@ -268,11 +268,17 @@ private extension ProfileManager {
}
func notifyRemoteEntities(_ result: EntitiesResult<Profile>) {
let isInitial = allRemoteProfiles.isEmpty
allRemoteProfiles = result.entities.reduce(into: [:]) {
$0[$1.id] = $1
}
objectWillChange.send()
// do not import on initial load
guard !isInitial else {
return
}
// pull remote updates into local profiles (best-effort)
let profilesToImport = allRemoteProfiles.values
Task.detached { [weak self] in