mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
put firing of the runOnNoteContentChange on entity level instead of service level, #3436
This commit is contained in:
parent
2525857c20
commit
14da697a4e
@ -11,6 +11,7 @@ const NoteRevision = require("./note_revision");
|
|||||||
const TaskContext = require("../../services/task_context");
|
const TaskContext = require("../../services/task_context");
|
||||||
const dayjs = require("dayjs");
|
const dayjs = require("dayjs");
|
||||||
const utc = require('dayjs/plugin/utc');
|
const utc = require('dayjs/plugin/utc');
|
||||||
|
const eventService = require("../../services/events");
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
|
|
||||||
const LABEL = 'label';
|
const LABEL = 'label';
|
||||||
@ -314,6 +315,11 @@ class Note extends AbstractEntity {
|
|||||||
utcDateChanged: pojo.utcDateModified,
|
utcDateChanged: pojo.utcDateModified,
|
||||||
isSynced: true
|
isSynced: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventService.emit(eventService.ENTITY_CHANGED, {
|
||||||
|
entityName: 'note_contents',
|
||||||
|
entity: this
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setJsonContent(content) {
|
setJsonContent(content) {
|
||||||
|
@ -597,11 +597,6 @@ function updateNoteContent(noteId, content) {
|
|||||||
content = saveLinks(note, content);
|
content = saveLinks(note, content);
|
||||||
|
|
||||||
note.setContent(content);
|
note.setContent(content);
|
||||||
|
|
||||||
eventService.emit(eventService.ENTITY_CHANGED, {
|
|
||||||
entityName: 'note_contents',
|
|
||||||
entity: note
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user