mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix sync of unsyncable options
This commit is contained in:
parent
cd45bcfd03
commit
94dabb81f6
@ -1,7 +1,6 @@
|
||||
const repository = require('./repository');
|
||||
const utils = require('./utils');
|
||||
const dateUtils = require('./date_utils');
|
||||
const syncTableService = require('./sync_table');
|
||||
const appInfo = require('./app_info');
|
||||
const Option = require('../entities/option');
|
||||
|
||||
@ -22,10 +21,6 @@ async function setOption(name, value) {
|
||||
throw new Error(`Option ${name} doesn't exist`);
|
||||
}
|
||||
|
||||
if (option.isSynced) {
|
||||
await syncTableService.addOptionsSync(name);
|
||||
}
|
||||
|
||||
option.value = value;
|
||||
|
||||
await option.save();
|
||||
@ -37,10 +32,6 @@ async function createOption(name, value, isSynced) {
|
||||
value: value,
|
||||
isSynced: isSynced
|
||||
}).save();
|
||||
|
||||
if (isSynced) {
|
||||
await syncTableService.addOptionsSync(name);
|
||||
}
|
||||
}
|
||||
|
||||
async function initOptions(startNotePath) {
|
||||
|
@ -59,7 +59,9 @@ async function updateEntity(entity) {
|
||||
|
||||
const primaryKey = entity[entity.constructor.primaryKeyName];
|
||||
|
||||
await syncTableService.addEntitySync(entity.constructor.tableName, primaryKey);
|
||||
if (entity.constructor.tableName !== 'options' || entity.isSynced) {
|
||||
await syncTableService.addEntitySync(entity.constructor.tableName, primaryKey);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user