message fixed.

This commit is contained in:
vorotamoroz
2021-10-15 01:26:15 +09:00
parent 225dbc795b
commit 832f311b4a
2 changed files with 10 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@@ -278,6 +278,7 @@ class LocalPouchDB {
} else { } else {
obj = await this.localDatabase.get(id); obj = await this.localDatabase.get(id);
} }
if (obj.type && obj.type == "leaf") { if (obj.type && obj.type == "leaf") {
//do nothing for leaf; //do nothing for leaf;
return false; return false;
@@ -286,7 +287,8 @@ class LocalPouchDB {
if (!obj.type || (obj.type && obj.type == "notes")) { if (!obj.type || (obj.type && obj.type == "notes")) {
// let note = obj as Notes; // let note = obj as Notes;
// note._deleted=true; // note._deleted=true;
await this.localDatabase.remove(id, opt); obj._deleted=true;
let r = await this.localDatabase.put(obj);
return true; return true;
// simple note // simple note
} }
@@ -445,7 +447,7 @@ class LocalPouchDB {
this.syncHandler.cancel(); this.syncHandler.cancel();
this.syncHandler.removeAllListeners(); this.syncHandler.removeAllListeners();
this.syncHandler = null; this.syncHandler = null;
this.addLog("Replication closed", true); this.addLog("Replication closed");
} }
async resetDatabase() { async resetDatabase() {
@@ -954,7 +956,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
let oldData = { data: old.data, deleted: old._deleted }; let oldData = { data: old.data, deleted: old._deleted };
let newData = { data: d.data, deleted: d._deleted }; let newData = { data: d.data, deleted: d._deleted };
if (JSON.stringify(oldData) == JSON.stringify(newData)) { if (JSON.stringify(oldData) == JSON.stringify(newData)) {
this.addLog("no changed" + fullpath); this.addLog("no changed" + fullpath + d._deleted);
return; return;
} }
// d._rev = old._rev; // d._rev = old._rev;