Fix syncable check in events listener

This commit is contained in:
Silvano Cerza 2025-01-23 13:12:42 +01:00
parent f23c00c32a
commit 524c7efed7

View file

@ -116,13 +116,24 @@ export default class EventsListener {
}
private isSyncable(filePath: string) {
return (
filePath === `${this.vault.configDir}/github-sync-metadata.json` ||
(this.settings.syncConfigDir &&
filePath.startsWith(this.vault.configDir)) ||
// Obsidian recommends not syncing the workspace files
if (filePath === `${this.vault.configDir}/github-sync-metadata.json`) {
// Manifest file must always be synced
return true;
} else if (
filePath === `${this.vault.configDir}/workspace.json` ||
filePath === `${this.vault.configDir}/workspace-mobile.json`
);
) {
// Obsidian recommends not syncing the workspace files
return false;
} else if (
this.settings.syncConfigDir &&
filePath.startsWith(this.vault.configDir)
) {
// Sync configs only if the user explicitly wants to
return true;
} else {
// All other files can be synced
return true;
}
}
}