From 148196f6263f0f8da27e0ed8872f2bc4aee37a80 Mon Sep 17 00:00:00 2001 From: Rizky Date: Mon, 29 Jan 2024 12:06:29 +0700 Subject: [PATCH] wip fix --- .../ed/panel/side/prop-instance/prop-text.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/web/src/nova/ed/panel/side/prop-instance/prop-text.tsx b/app/web/src/nova/ed/panel/side/prop-instance/prop-text.tsx index 516bac61..e6425108 100644 --- a/app/web/src/nova/ed/panel/side/prop-instance/prop-text.tsx +++ b/app/web/src/nova/ed/panel/side/prop-instance/prop-text.tsx @@ -55,16 +55,19 @@ export const EdPropInstanceText: FC<{ ); }; -const unquote = (text: string) => { - const str = text.trim(); - const first = str[0]; +const unquote = (text: any) => { + if (typeof text === "string") { + const str = text.trim(); + const first = str[0]; - if (['"', "'", "`"].includes(first)) { - if (first === str[str.length - 1]) { - return str.slice(1, -1); + if (['"', "'", "`"].includes(first)) { + if (first === str[str.length - 1]) { + return str.slice(1, -1); + } } + return str; } - return str; + return ""; }; export function AutoHeightTextarea({