mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 09:58:32 +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 dayjs = require("dayjs");
|
||||
const utc = require('dayjs/plugin/utc');
|
||||
const eventService = require("../../services/events");
|
||||
dayjs.extend(utc)
|
||||
|
||||
const LABEL = 'label';
|
||||
@ -314,6 +315,11 @@ class Note extends AbstractEntity {
|
||||
utcDateChanged: pojo.utcDateModified,
|
||||
isSynced: true
|
||||
});
|
||||
|
||||
eventService.emit(eventService.ENTITY_CHANGED, {
|
||||
entityName: 'note_contents',
|
||||
entity: this
|
||||
});
|
||||
}
|
||||
|
||||
setJsonContent(content) {
|
||||
|
@ -597,11 +597,6 @@ function updateNoteContent(noteId, content) {
|
||||
content = saveLinks(note, content);
|
||||
|
||||
note.setContent(content);
|
||||
|
||||
eventService.emit(eventService.ENTITY_CHANGED, {
|
||||
entityName: 'note_contents',
|
||||
entity: note
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user