From 671dc7f77cd3174bead6a49d3b875e9bd5550e87 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 4 Oct 2024 15:50:45 +0200 Subject: [PATCH] Do not import remote profiles on first load --- .../Sources/AppLibrary/Business/ProfileManager.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Passepartout/Library/Sources/AppLibrary/Business/ProfileManager.swift b/Passepartout/Library/Sources/AppLibrary/Business/ProfileManager.swift index 8575b02a..b798a014 100644 --- a/Passepartout/Library/Sources/AppLibrary/Business/ProfileManager.swift +++ b/Passepartout/Library/Sources/AppLibrary/Business/ProfileManager.swift @@ -268,11 +268,17 @@ private extension ProfileManager { } func notifyRemoteEntities(_ result: EntitiesResult) { + 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