From 57f0dbc9ce22c028fedbf563820935d65f6bd0ee Mon Sep 17 00:00:00 2001 From: Brian Ignacio Date: Fri, 17 Nov 2023 19:54:35 +0800 Subject: [PATCH] try object create null --- src/views/system-view/main.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/system-view/main.ts b/src/views/system-view/main.ts index be1118781..7c004c413 100644 --- a/src/views/system-view/main.ts +++ b/src/views/system-view/main.ts @@ -32,7 +32,15 @@ app.mount("#app"); const store = useSystemViewStore(); window.addEventListener("message", (evt: MessageEvent) => { - const message: { command: string; value: any } = { ...evt.data }; + const eventData = Object.create(null); + + // Copy properties from evt.data to eventData + for (const key in evt.data) { + if (evt.data.hasOwnProperty(key)) { + eventData[key] = evt.data[key]; + } + } + const message: { command: string; value: any } = eventData; switch (message.command) { case "initialLoad": store.rawData = message.value;