diff options
author | Sebastian <sebasjm@gmail.com> | 2021-08-13 18:04:05 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-08-13 18:04:30 -0300 |
commit | e9bb85a212dbd9b86875e89a0aca5d805e2ad61b (patch) | |
tree | 7fb2f9f28fc382d7348cd45cb730b302217099c7 /packages/taler-wallet-webextension/src/components/Diagnostics.tsx | |
parent | eb553be84163946e4ffa5b2a4dfaa2029aebc534 (diff) | |
download | wallet-core-e9bb85a212dbd9b86875e89a0aca5d805e2ad61b.tar.xz |
new wallet UI and more tests
Diffstat (limited to 'packages/taler-wallet-webextension/src/components/Diagnostics.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/components/Diagnostics.tsx | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/packages/taler-wallet-webextension/src/components/Diagnostics.tsx b/packages/taler-wallet-webextension/src/components/Diagnostics.tsx index 146b0dd3e..b36525dbf 100644 --- a/packages/taler-wallet-webextension/src/components/Diagnostics.tsx +++ b/packages/taler-wallet-webextension/src/components/Diagnostics.tsx @@ -4,30 +4,12 @@ import { PageLink } from "../renderHtml"; import { WalletDiagnostics } from "@gnu-taler/taler-util"; import { JSX } from "preact/jsx-runtime"; +interface Props { + timedOut: boolean; + diagnostics: WalletDiagnostics | undefined +} -export function Diagnostics(): JSX.Element | null { - const [timedOut, setTimedOut] = useState(false); - const [diagnostics, setDiagnostics] = useState<WalletDiagnostics | undefined>( - undefined - ); - - useEffect(() => { - let gotDiagnostics = false; - setTimeout(() => { - if (!gotDiagnostics) { - console.error("timed out"); - setTimedOut(true); - } - }, 1000); - const doFetch = async (): Promise<void> => { - const d = await getDiagnostics(); - console.log("got diagnostics", d); - gotDiagnostics = true; - setDiagnostics(d); - }; - console.log("fetching diagnostics"); - doFetch(); - }, []); +export function Diagnostics({timedOut, diagnostics}: Props): JSX.Element | null { if (timedOut) { return <p>Diagnostics timed out. Could not talk to the wallet backend.</p>; |