mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-04-30 09:19:23 -05:00
refactored access to options on frontend
This commit is contained in:
@@ -110,9 +110,7 @@ async function updateEntity(entity) {
|
||||
const primaryKey = entity[primaryKeyName];
|
||||
|
||||
if (entity.isChanged) {
|
||||
if (entityName !== 'options' || entity.isSynced) {
|
||||
await syncTableService.addEntitySync(entityName, primaryKey);
|
||||
}
|
||||
await syncTableService.addEntitySync(entityName, primaryKey);
|
||||
|
||||
if (!cls.isEntityEventsDisabled()) {
|
||||
const eventPayload = {
|
||||
|
||||
@@ -315,10 +315,13 @@ async function getSyncRecords(syncs) {
|
||||
let length = 0;
|
||||
|
||||
for (const sync of syncs) {
|
||||
const record = {
|
||||
sync: sync,
|
||||
entity: await getEntityRow(sync.entityName, sync.entityId)
|
||||
};
|
||||
const entity = await getEntityRow(sync.entityName, sync.entityId);
|
||||
|
||||
if (sync.entityName === 'options' && !entity.isSynced) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const record = { sync, entity };
|
||||
|
||||
records.push(record);
|
||||
|
||||
|
||||
@@ -92,6 +92,9 @@ async function fillInAdditionalProperties(sync) {
|
||||
} else if (sync.entityName === 'note_reordering') {
|
||||
sync.positions = await sql.getMap(`SELECT branchId, notePosition FROM branches WHERE isDeleted = 0 AND parentNoteId = ?`, [sync.entityId]);
|
||||
}
|
||||
else if (sync.entityName === 'options') {
|
||||
sync.entity = await sql.getRow(`SELECT * FROM options WHERE name = ?`, [sync.entityId]);
|
||||
}
|
||||
}
|
||||
|
||||
async function sendPing(client) {
|
||||
|
||||
Reference in New Issue
Block a user