From 3bd65baf7b081740b659b82c4ee1ba7c45c9ca9e Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Thu, 23 Jan 2025 13:12:57 +0100 Subject: [PATCH] Fix config sync during onboarding --- src/views/onboarding/component.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/views/onboarding/component.tsx b/src/views/onboarding/component.tsx index dfc05f7..885aece 100644 --- a/src/views/onboarding/component.tsx +++ b/src/views/onboarding/component.tsx @@ -308,6 +308,16 @@ const FirstSyncStepComponent = ({ }, ); await syncManager.loadMetadata(); + // When loading the plugin we also load the metadata, though since by default + // configs sync is enabled we need to remove them if necessary. Otherwise they + // would be synced even if the user doesn't want them to be. + // We also add them if they want to sync config dirs just for completeness, though + // they should already be there. + if (stepData.sync.syncConfigDir) { + await syncManager.addConfigDirToMetadata(); + } else { + await syncManager.removeConfigDirFromMetadata(); + } try { await syncManager.firstSync(); } catch (e) {