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) { private isSyncable(filePath: string) {
return ( if (filePath === `${this.vault.configDir}/github-sync-metadata.json`) {
filePath === `${this.vault.configDir}/github-sync-metadata.json` || // Manifest file must always be synced
(this.settings.syncConfigDir && return true;
filePath.startsWith(this.vault.configDir)) || } else if (
// Obsidian recommends not syncing the workspace files
filePath === `${this.vault.configDir}/workspace.json` || filePath === `${this.vault.configDir}/workspace.json` ||
filePath === `${this.vault.configDir}/workspace-mobile.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;
}
} }
} }