mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server-ts: Fix undefined in task_context
This commit is contained in:
parent
9f6a8dc75c
commit
040ed39a4e
@ -49,7 +49,7 @@ class TaskContext {
|
|||||||
type: 'taskProgressCount',
|
type: 'taskProgressCount',
|
||||||
taskId: this.taskId,
|
taskId: this.taskId,
|
||||||
taskType: this.taskType,
|
taskType: this.taskType,
|
||||||
data: this.data || undefined,
|
data: this.data,
|
||||||
progressCount: this.progressCount
|
progressCount: this.progressCount
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ class TaskContext {
|
|||||||
type: 'taskError',
|
type: 'taskError',
|
||||||
taskId: this.taskId,
|
taskId: this.taskId,
|
||||||
taskType: this.taskType,
|
taskType: this.taskType,
|
||||||
data: this.data || undefined,
|
data: this.data,
|
||||||
message: message
|
message: message
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ class TaskContext {
|
|||||||
type: 'taskSucceeded',
|
type: 'taskSucceeded',
|
||||||
taskId: this.taskId,
|
taskId: this.taskId,
|
||||||
taskType: this.taskType,
|
taskType: this.taskType,
|
||||||
data: this.data || undefined,
|
data: this.data,
|
||||||
result: result
|
result: result
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ interface Message {
|
|||||||
data?: {
|
data?: {
|
||||||
lastSyncedPush?: number | null,
|
lastSyncedPush?: number | null,
|
||||||
entityChanges?: any[]
|
entityChanges?: any[]
|
||||||
},
|
} | null,
|
||||||
lastSyncedPush?: number | null,
|
lastSyncedPush?: number | null,
|
||||||
|
|
||||||
progressCount?: number;
|
progressCount?: number;
|
||||||
@ -142,7 +142,7 @@ function fillInAdditionalProperties(entityChange: EntityChange) {
|
|||||||
if (!entityChange.entity) {
|
if (!entityChange.entity) {
|
||||||
entityChange.entity = sql.getRow(`SELECT * FROM notes WHERE noteId = ?`, [entityChange.entityId]);
|
entityChange.entity = sql.getRow(`SELECT * FROM notes WHERE noteId = ?`, [entityChange.entityId]);
|
||||||
|
|
||||||
if (entityChange.entity && entityChange.entity.isProtected) {
|
if (entityChange.entity?.isProtected) {
|
||||||
entityChange.entity.title = protectedSessionService.decryptString(entityChange.entity.title || "");
|
entityChange.entity.title = protectedSessionService.decryptString(entityChange.entity.title || "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -157,7 +157,7 @@ function fillInAdditionalProperties(entityChange: EntityChange) {
|
|||||||
|
|
||||||
if (parentNote) {
|
if (parentNote) {
|
||||||
for (const childBranch of parentNote.getChildBranches()) {
|
for (const childBranch of parentNote.getChildBranches()) {
|
||||||
if (childBranch && childBranch.branchId) {
|
if (childBranch?.branchId) {
|
||||||
entityChange.positions[childBranch.branchId] = childBranch.notePosition;
|
entityChange.positions[childBranch.branchId] = childBranch.notePosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user