From 73b104a968a2683d0563da0e8b7c4f6e9d2a50f0 Mon Sep 17 00:00:00 2001 From: sevichecc <91365763+Sevichecc@users.noreply.github.com> Date: Sat, 15 Apr 2023 02:20:07 +0800 Subject: [PATCH] refactor: set statusInfo init to null --- src/components/Actions.tsx | 9 +++++++++ src/simple-status.tsx | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 src/components/Actions.tsx diff --git a/src/components/Actions.tsx b/src/components/Actions.tsx new file mode 100644 index 0000000..2d549fb --- /dev/null +++ b/src/components/Actions.tsx @@ -0,0 +1,9 @@ +const Actions = () => { + return ( + <> + + + ) +} + +export default Actions diff --git a/src/simple-status.tsx b/src/simple-status.tsx index 02d699e..93f6745 100644 --- a/src/simple-status.tsx +++ b/src/simple-status.tsx @@ -14,9 +14,9 @@ export default function Command(props: LaunchProps<{ draftValues: Partial(draftValues?.spoiler_text || ""); const [isMarkdown, setIsMarkdown] = useState(true); - const cached = cache.get("latest-pubished-status"); + const cached = cache.get("latest_published_status"); - const [statusInfo, setStatusInfo] = useState(cached ? JSON.parse(cached) : ""); + const [statusInfo, setStatusInfo] = useState(cached ? JSON.parse(cached) : null); const [openActionText, setOpenActionText] = useState("Open the last published status"); useEffect(() => { @@ -34,7 +34,7 @@ export default function Command(props: LaunchProps<{ draftValues: Partial { @@ -52,7 +52,7 @@ export default function Command(props: LaunchProps<{ draftValues: Partial - + { statusInfo && } } >