From 2d549751e5bfd7838a41ca243f68d5eef3630d46 Mon Sep 17 00:00:00 2001 From: Kodai Aoyama Date: Mon, 16 May 2022 01:30:59 +0900 Subject: [PATCH] fix type --- .../controls/template/EditableHandlebarsComponent.jsx | 8 ++++---- ui/src/rete/controls/template/EditablePugComponent.jsx | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/src/rete/controls/template/EditableHandlebarsComponent.jsx b/ui/src/rete/controls/template/EditableHandlebarsComponent.jsx index ce8eca0..9ef3021 100644 --- a/ui/src/rete/controls/template/EditableHandlebarsComponent.jsx +++ b/ui/src/rete/controls/template/EditableHandlebarsComponent.jsx @@ -5,11 +5,11 @@ import useInterval from "use-interval"; export const EditableHandlebarsComponent = ({ value, onChange }) => { const [code, setCode] = useState(value); const [warn, setWarn] = useState(false); - const [stack, setStack] = useState(null); + const [stack, setStack] = useState(""); useInterval(() => { - if (stack !== null) { + if (stack !== "") { import("react-hot-toast").then((_) => _.toast.error(stack)); - setStack(null); + setStack(""); } }, 8000); @@ -25,7 +25,7 @@ export const EditableHandlebarsComponent = ({ value, onChange }) => { .then((h) => { h.precompile(c); setWarn(false); - setStack(null); + setStack(""); }) .catch((e) => { setStack(e.message); diff --git a/ui/src/rete/controls/template/EditablePugComponent.jsx b/ui/src/rete/controls/template/EditablePugComponent.jsx index f749e5f..092c16c 100644 --- a/ui/src/rete/controls/template/EditablePugComponent.jsx +++ b/ui/src/rete/controls/template/EditablePugComponent.jsx @@ -7,11 +7,11 @@ import useInterval from "use-interval"; export const EditablePugComponent = ({ value, onChange }) => { const [code, setCode] = useState(value); const [warn, setWarn] = useState(false); - const [stack, setStack] = useState(null); + const [stack, setStack] = useState(""); useInterval(() => { - if (stack !== null) { + if (stack !== "") { import("react-hot-toast").then((_) => _.toast.error(stack)); - setStack(null); + setStack(""); } }, 8000); @@ -26,7 +26,7 @@ export const EditablePugComponent = ({ value, onChange }) => { try { if (c) pug.compile(c); setWarn(false); - setStack(null); + setStack(""); } catch (e) { setStack(e.message); setWarn(true);