From 036f8a463fca11584fbca45ec1c4c9a918433f9d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 8 Sep 2023 11:15:13 -0300 Subject: remove diag, check tos --- .../src/hooks/useDiagnostics.ts | 44 ---------------------- 1 file changed, 44 deletions(-) delete mode 100644 packages/taler-wallet-webextension/src/hooks/useDiagnostics.ts (limited to 'packages/taler-wallet-webextension/src/hooks/useDiagnostics.ts') diff --git a/packages/taler-wallet-webextension/src/hooks/useDiagnostics.ts b/packages/taler-wallet-webextension/src/hooks/useDiagnostics.ts deleted file mode 100644 index fcd31b3c6..000000000 --- a/packages/taler-wallet-webextension/src/hooks/useDiagnostics.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2022 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see - */ - -import { WalletDiagnostics } from "@gnu-taler/taler-util"; -import { useEffect, useState } from "preact/hooks"; -import { useBackendContext } from "../context/backend.js"; - -export function useDiagnostics(): [WalletDiagnostics | undefined, boolean] { - const [timedOut, setTimedOut] = useState(false); - const api = useBackendContext(); - const [diagnostics, setDiagnostics] = useState( - undefined, - ); - - useEffect(() => { - let gotDiagnostics = false; - setTimeout(() => { - if (!gotDiagnostics) { - console.error("timed out"); - setTimedOut(true); - } - }, 1000); - const doFetch = async (): Promise => { - const d = await api.background.call("getDiagnostics", undefined); - gotDiagnostics = true; - setDiagnostics(d); - }; - doFetch(); - }, []); - return [diagnostics, timedOut]; -} -- cgit v1.2.3