Skip to content

Build your personal knowledge base with Trilium Notes

chore(core): fix missing CLS method

Elian Doranf5a77477aa5c
diff --git a/apps/server/src/services/cls.ts b/apps/server/src/services/cls.ts
index 8ecb3132ff..ecbef741ed 100644
--- a/apps/server/src/services/cls.ts
+++ b/apps/server/src/services/cls.ts
@@ -1,5 +1,5 @@
import type { EntityChange } from "@triliumnext/commons";
-import { getContext, getHoistedNoteId as getHoistedNoteIdInternal } from "@triliumnext/core/src/services/context";
+import { getContext, getHoistedNoteId as getHoistedNoteIdInternal, isEntityEventsDisabled as isEntityEventsDisabledInternal } from "@triliumnext/core/src/services/context";
type Callback = (...args: any[]) => any;
@@ -34,7 +34,7 @@ function enableEntityEvents() {
}
function isEntityEventsDisabled() {
- return !!getContext().get("disableEntityEvents");
+ return isEntityEventsDisabledInternal();
}
function setMigrationRunning(running: boolean) {
diff --git a/packages/trilium-core/src/services/context.ts b/packages/trilium-core/src/services/context.ts
index 7f783853c5..870596ae33 100644
--- a/packages/trilium-core/src/services/context.ts
+++ b/packages/trilium-core/src/services/context.ts
@@ -20,3 +20,7 @@ export function getContext(): ExecutionContext {
export function getHoistedNoteId() {
return getContext().get("hoistedNoteId") || "root";
}
+
+export function isEntityEventsDisabled() {
+ return !!getContext().get("disableEntityEvents");
+}