Skip to content

Commit 2ea7cf5

Browse files
committed
fixed: #2889
1 parent 07b1633 commit 2ea7cf5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/core/managers/MonkeyPatchManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ export class MonkeyPatchManager {
4343
T extends View,
4444
>(this: Workspace, type: ViewConstructor<T>): T | null {
4545
const result = old.call(this, type) as T | null;
46+
const stackTrace = new Error().stack ?? "";
47+
if (!MonkeyPatchManager.isCallerFromTemplaterPlugin(stackTrace)) {
48+
return result;
49+
}
4650
const maybeEAView = this.getMostRecentLeaf()?.view;
4751
if (
4852
!maybeEAView ||
4953
maybeEAView.getViewType() !== VIEW_TYPE_EXCALIDRAW
5054
) {
5155
return result;
5256
}
53-
const stackTrace = new Error().stack ?? "";
54-
if (!MonkeyPatchManager.isCallerFromTemplaterPlugin(stackTrace)) {
55-
return result;
56-
}
5757
const leafOrNode = (
5858
maybeEAView as ExcalidrawView
5959
).getActiveEmbeddable();

0 commit comments

Comments
 (0)