From 61b92fe91d9e8c1bffefb200276b6806260bf14c Mon Sep 17 00:00:00 2001 From: azu Date: Sun, 18 Apr 2021 22:31:59 +0900 Subject: [PATCH] fix(webextension): fix to install --- packages/webextension/app/scripts/install-dialog.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/webextension/app/scripts/install-dialog.tsx b/packages/webextension/app/scripts/install-dialog.tsx index df12b40..e560a5b 100644 --- a/packages/webextension/app/scripts/install-dialog.tsx +++ b/packages/webextension/app/scripts/install-dialog.tsx @@ -38,7 +38,7 @@ async function installHandler({ } function App() { - const [install, setInstall] = useState<"no" | "yes" | "installing">("no"); + const [install, setInstall] = useState<"Install" | "Installed" | "Waiting">("Waiting"); const [scriptURL, setScriptURL] = useState(""); const [scriptContent, setScriptContent] = useState(""); const [metadata, setMetadata] = useState(null); @@ -52,12 +52,13 @@ function App() { scriptURL }).catch((error) => { console.error(error); - setInstall("no"); + setInstall("Install"); }); - setInstall("yes"); + setInstall("Installed"); }, [scriptContent, metadata, scriptURL]); useEffect(() => { (async function main() { + setInstall("Install"); const url = new URL(location.href); const script = url.searchParams.get("script"); if (!script) { @@ -79,11 +80,12 @@ function App() { + {install === "Installed" ? "Success to install!" : null}

Script metadata