From eda8b1550c110edefb60709e018277e60392f542 Mon Sep 17 00:00:00 2001 From: Valtteri Karesto Date: Fri, 17 Jun 2022 13:42:19 +0300 Subject: [PATCH] If not string, stringify it --- components/RunScript/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/RunScript/index.tsx b/components/RunScript/index.tsx index 6351698..2de849c 100644 --- a/components/RunScript/index.tsx +++ b/components/RunScript/index.tsx @@ -79,7 +79,7 @@ const RunScript: React.FC<{ file: IFile }> = ({ file }) => { if (e.data.type === "log" || e.data.type === "error") { const data: ILog[] = e.data.args.map((msg: any) => ({ type: e.data.type, - message: msg.toString(), + message: typeof msg === "string" ? msg : JSON.stringify(msg, null, 2), })); state.scriptLogs = [...snap.scriptLogs, ...data]; }