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.
This commit is contained in:
xvqinghong 2024-09-29 09:20:27 +08:00 committed by GitHub
parent 9acae1b077
commit 17708359a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}
}