mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
added is_synced to options to better differentiate between synced and not synced options
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
const sql = require('./sql');
|
||||
const log = require('./log');
|
||||
const options = require('./options');
|
||||
const eventLog = require('./event_log');
|
||||
const notes = require('./notes');
|
||||
const sync_table = require('./sync_table');
|
||||
@@ -63,12 +62,12 @@ async function updateNoteReordering(entity, sourceId) {
|
||||
}
|
||||
|
||||
async function updateOptions(entity, sourceId) {
|
||||
if (!options.SYNCED_OPTIONS.includes(entity.opt_name)) {
|
||||
const orig = await sql.getFirstOrNull("SELECT * FROM options WHERE opt_name = ?", [entity.opt_name]);
|
||||
|
||||
if (!orig.is_synced) {
|
||||
return;
|
||||
}
|
||||
|
||||
const orig = await sql.getFirstOrNull("SELECT * FROM options WHERE opt_name = ?", [entity.opt_name]);
|
||||
|
||||
await sql.doInTransaction(async () => {
|
||||
if (orig === null || orig.date_modified < entity.date_modified) {
|
||||
await sql.replace('options', entity);
|
||||
|
||||
Reference in New Issue
Block a user