Fixed file deletion failures.

This commit is contained in:
vorotamoroz
2022-07-29 13:33:33 +09:00
parent c88c939cd9
commit f0ffb0620e
6 changed files with 8 additions and 7 deletions

View File

@@ -462,7 +462,7 @@ export class LocalPouchDB {
} else {
obj = await this.localDatabase.get(id);
}
const revDeletion = ("rev" in opt ? opt.rev : "") != "";
const revDeletion = opt && (("rev" in opt ? opt.rev : "") != "");
if (obj.type && obj.type == "leaf") {
//do nothing for leaf;

View File

@@ -821,7 +821,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
try {
Logger(`file save ${file.path} into db`);
await this.updateIntoDB(file);
Logger(`deleted ${oldFile} into db`);
Logger(`deleted ${oldFile} from db`);
await this.deleteFromDBbyPath(oldFile);
} catch (ex) {
Logger(ex);