mirror of
https://github.com/zadam/trilium.git
synced 2024-12-26 01:01:26 +08:00
create sync records only if sync is configured. This will prevent sync conflicts after document fork.
This commit is contained in:
parent
2fa57b79fd
commit
17c90262c2
2 changed files with 10 additions and 7 deletions
|
@ -1 +1 @@
|
||||||
module.exports = { build_date:"2017-12-10T23:23:04-05:00", build_revision: "bdeaa2829d4c5436e86d0d943a2a332d0c016804" };
|
module.exports = { build_date:"2017-12-12T23:57:58-05:00", build_revision: "2fa57b79fd972b3eda6eb8ef1d26e9915b75fd96" };
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
const sql = require('./sql');
|
const sql = require('./sql');
|
||||||
const source_id = require('./source_id');
|
const source_id = require('./source_id');
|
||||||
const utils = require('./utils');
|
const utils = require('./utils');
|
||||||
|
const sync = require('./sync');
|
||||||
|
|
||||||
async function addNoteSync(noteId, sourceId) {
|
async function addNoteSync(noteId, sourceId) {
|
||||||
await addEntitySync("notes", noteId, sourceId)
|
await addEntitySync("notes", noteId, sourceId)
|
||||||
|
@ -27,12 +28,14 @@ async function addRecentNoteSync(notePath, sourceId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addEntitySync(entityName, entityId, sourceId) {
|
async function addEntitySync(entityName, entityId, sourceId) {
|
||||||
await sql.replace("sync", {
|
if (sync.isSyncSetup) {
|
||||||
entity_name: entityName,
|
await sql.replace("sync", {
|
||||||
entity_id: entityId,
|
entity_name: entityName,
|
||||||
sync_date: utils.nowDate(),
|
entity_id: entityId,
|
||||||
source_id: sourceId || source_id.currentSourceId
|
sync_date: utils.nowDate(),
|
||||||
});
|
source_id: sourceId || source_id.currentSourceId
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
Loading…
Reference in a new issue