Skip to content

Commit

Permalink
try object create null
Browse files Browse the repository at this point in the history
  • Loading branch information
brianignacio5 committed Nov 17, 2023
1 parent 1056346 commit 57f0dbc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/views/system-view/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 57f0dbc

Please sign in to comment.