mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-13 01:35:57 +00:00
message fixed.
This commit is contained in:
8
main.ts
8
main.ts
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user