1
0
mirror of https://github.com/vrtmrz/obsidian-livesync.git synced 2024-12-15 09:14:07 +02:00
- Now we can merge JSON files even if they have entries which cannot be compared.
This commit is contained in:
vorotamoroz 2023-01-25 22:37:55 +09:00
parent 2fdc7669f3
commit bc568ff479

View File

@ -2297,6 +2297,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
}
async mergeObject(path: string, baseRev: string, currentRev: string, conflictedRev: string): Promise<string | false> {
try {
const baseLeaf = await this.getConflictedDoc(path, baseRev);
const leftLeaf = await this.getConflictedDoc(path, currentRev);
const rightLeaf = await this.getConflictedDoc(path, conflictedRev);
@ -2314,7 +2315,6 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
{ mtime: rightLeaf.mtime, patch: diffRight }
].sort((a, b) => a.mtime - b.mtime);
let newObj = { ...baseObj };
try {
for (const patch of patches) {
newObj = applyPatch(newObj, patch.patch);
}