1 parent 07b1633 commit 2ea7cf5Copy full SHA for 2ea7cf5
1 file changed
src/core/managers/MonkeyPatchManager.ts
@@ -43,17 +43,17 @@ export class MonkeyPatchManager {
43
T extends View,
44
>(this: Workspace, type: ViewConstructor<T>): T | null {
45
const result = old.call(this, type) as T | null;
46
+ const stackTrace = new Error().stack ?? "";
47
+ if (!MonkeyPatchManager.isCallerFromTemplaterPlugin(stackTrace)) {
48
+ return result;
49
+ }
50
const maybeEAView = this.getMostRecentLeaf()?.view;
51
if (
52
!maybeEAView ||
53
maybeEAView.getViewType() !== VIEW_TYPE_EXCALIDRAW
54
) {
55
return result;
56
}
- const stackTrace = new Error().stack ?? "";
- if (!MonkeyPatchManager.isCallerFromTemplaterPlugin(stackTrace)) {
- return result;
- }
57
const leafOrNode = (
58
maybeEAView as ExcalidrawView
59
).getActiveEmbeddable();
0 commit comments