mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
entity events are not triggered on imported entities
This commit is contained in:
@@ -5,6 +5,7 @@ const enexImportService = require('../../services/import/enex');
|
||||
const opmlImportService = require('../../services/import/opml');
|
||||
const tarImportService = require('../../services/import/tar');
|
||||
const markdownImportService = require('../../services/import/markdown');
|
||||
const cls = require('../../services/cls');
|
||||
const path = require('path');
|
||||
|
||||
async function importToBranch(req) {
|
||||
@@ -23,6 +24,10 @@ async function importToBranch(req) {
|
||||
|
||||
const extension = path.extname(file.originalname).toLowerCase();
|
||||
|
||||
// running all the event handlers on imported notes (and attributes) is slow
|
||||
// and may produce unintended consequences
|
||||
cls.disableEntityEvents();
|
||||
|
||||
if (extension === '.tar') {
|
||||
return await tarImportService.importTar(file.buffer, parentNote);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user