From 17708359a1246ff96b9d9aaabf5c709a62e85c3a Mon Sep 17 00:00:00 2001 From: xvqinghong <46815565+xvqinghong@users.noreply.github.com> Date: Sun, 29 Sep 2024 09:20:27 +0800 Subject: [PATCH] fix bug of unwished synchronizing Config Directory and Bookmarks File (#816) In the original code, if we set syncConfigDir to false, which means we don't want to sync this directory, but it will also cause `if( syncConfigDir && isInsideObsFolder(key, configDir) )` statement NEVER be entered. Thus, in the original code, our setting is actually be ignored. --- pro/src/sync.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pro/src/sync.ts b/pro/src/sync.ts index 5c0bbe6..6f2a9fd 100644 --- a/pro/src/sync.ts +++ b/pro/src/sync.ts @@ -202,15 +202,19 @@ export const checkIsSkipItemOrNotByName = ( } } } - if (syncConfigDir && isInsideObsFolder(key, configDir)) { - if (finalIsIgnored === undefined) { + if (isInsideObsFolder(key, configDir) && finalIsIgnored === undefined) { + if(syncConfigDir){ finalIsIgnored = false; + } else{ + finalIsIgnored = true; } } - if (syncBookmarks && isBookmarksFile(key, configDir)) { - if (finalIsIgnored === undefined) { + if (isBookmarksFile(key, configDir) && finalIsIgnored === undefined) { + if(syncBookmarks){ finalIsIgnored = false; + } else{ + finalIsIgnored = true; } }