mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
protect/unprotect tree reports progress via notifications
This commit is contained in:
@@ -177,11 +177,13 @@ async function createNote(parentNoteId, title, content = "", extraOptions = {})
|
||||
return {note, branch};
|
||||
}
|
||||
|
||||
async function protectNoteRecursively(note, protect) {
|
||||
async function protectNoteRecursively(note, protect, taskContext) {
|
||||
await protectNote(note, protect);
|
||||
|
||||
taskContext.increaseProgressCount();
|
||||
|
||||
for (const child of await note.getChildNotes()) {
|
||||
await protectNoteRecursively(child, protect);
|
||||
await protectNoteRecursively(child, protect, taskContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ class TaskContext {
|
||||
type: 'task-progress-count',
|
||||
taskId: this.taskId,
|
||||
taskType: this.taskType,
|
||||
data: this.data,
|
||||
progressCount: this.progressCount
|
||||
});
|
||||
}
|
||||
@@ -45,6 +46,7 @@ class TaskContext {
|
||||
type: 'task-error',
|
||||
taskId: this.taskId,
|
||||
taskType: this.taskType,
|
||||
data: this.data,
|
||||
message: message
|
||||
});
|
||||
}
|
||||
@@ -54,6 +56,7 @@ class TaskContext {
|
||||
type: 'task-succeeded',
|
||||
taskId: this.taskId,
|
||||
taskType: this.taskType,
|
||||
data: this.data,
|
||||
result: result
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user