Skip to content

Commit bf280c6

Browse files
liujupingLeoYuan
authored andcommitted
fix: fix monitor utils incorrect assignment method
1 parent 75626d8 commit bf280c6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/editor-core/src/utils/monitor.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export class Monitor {
22
fn = (params: any) => {
3-
const { AES } = window as any;
3+
const { AES = {} } = window as any;
44
if (typeof AES.log === 'function') {
55
const { p1 = '', p2 = '', p3 = '', p4 = 'OTHER', ...rest } = params || {};
66
AES.log('event', {
@@ -13,10 +13,6 @@ export class Monitor {
1313
}
1414
};
1515

16-
constructor() {
17-
(window as any).AES = (window as any).AES || {};
18-
}
19-
2016
register(fn: () => any) {
2117
if (typeof fn === 'function') {
2218
this.fn = fn;
@@ -30,7 +26,7 @@ export class Monitor {
3026
}
3127

3228
setConfig(key: string | object, value?: string): void {
33-
const { AES } = window as any;
29+
const { AES = {} } = window as any;
3430
if (typeof AES?.setConfig !== 'function') {
3531
return;
3632
}

0 commit comments

Comments
 (0)