From a994009d2f094c4d9c12da68dac3abb28bdef4b3 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Tue, 16 Nov 2021 13:59:53 -0300
Subject: reserveCreated new design

---
 .../src/components/Diagnostics.tsx                 | 75 ++++++++++------------
 1 file changed, 35 insertions(+), 40 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/components/Diagnostics.tsx')

diff --git a/packages/taler-wallet-webextension/src/components/Diagnostics.tsx b/packages/taler-wallet-webextension/src/components/Diagnostics.tsx
index 0f8afd525..d368a10bf 100644
--- a/packages/taler-wallet-webextension/src/components/Diagnostics.tsx
+++ b/packages/taler-wallet-webextension/src/components/Diagnostics.tsx
@@ -15,8 +15,7 @@
  */
 
 import { WalletDiagnostics } from "@gnu-taler/taler-util";
-import { h } from "preact";
-import { JSX } from "preact/jsx-runtime";
+import { Fragment, h, VNode } from "preact";
 import { PageLink } from "../renderHtml";
 
 interface Props {
@@ -24,51 +23,47 @@ interface Props {
   diagnostics: WalletDiagnostics | undefined;
 }
 
-export function Diagnostics({
-  timedOut,
-  diagnostics,
-}: Props): JSX.Element | null {
+export function Diagnostics({ timedOut, diagnostics }: Props): VNode {
   if (timedOut) {
     return <p>Diagnostics timed out. Could not talk to the wallet backend.</p>;
   }
 
   if (diagnostics) {
     if (diagnostics.errors.length === 0) {
-      return null;
-    } else {
-      return (
-        <div
-          style={{
-            borderLeft: "0.5em solid red",
-            paddingLeft: "1em",
-            paddingTop: "0.2em",
-            paddingBottom: "0.2em",
-          }}
-        >
-          <p>Problems detected:</p>
-          <ol>
-            {diagnostics.errors.map((errMsg) => (
-              <li key={errMsg}>{errMsg}</li>
-            ))}
-          </ol>
-          {diagnostics.firefoxIdbProblem ? (
-            <p>
-              Please check in your <code>about:config</code> settings that you
-              have IndexedDB enabled (check the preference name{" "}
-              <code>dom.indexedDB.enabled</code>).
-            </p>
-          ) : null}
-          {diagnostics.dbOutdated ? (
-            <p>
-              Your wallet database is outdated. Currently automatic migration is
-              not supported. Please go{" "}
-              <PageLink pageName="/reset-required">here</PageLink> to reset the
-              wallet database.
-            </p>
-          ) : null}
-        </div>
-      );
+      return <Fragment />;
     }
+    return (
+      <div
+        style={{
+          borderLeft: "0.5em solid red",
+          paddingLeft: "1em",
+          paddingTop: "0.2em",
+          paddingBottom: "0.2em",
+        }}
+      >
+        <p>Problems detected:</p>
+        <ol>
+          {diagnostics.errors.map((errMsg) => (
+            <li key={errMsg}>{errMsg}</li>
+          ))}
+        </ol>
+        {diagnostics.firefoxIdbProblem ? (
+          <p>
+            Please check in your <code>about:config</code> settings that you
+            have IndexedDB enabled (check the preference name{" "}
+            <code>dom.indexedDB.enabled</code>).
+          </p>
+        ) : null}
+        {diagnostics.dbOutdated ? (
+          <p>
+            Your wallet database is outdated. Currently automatic migration is
+            not supported. Please go{" "}
+            <PageLink pageName="/reset-required">here</PageLink> to reset the
+            wallet database.
+          </p>
+        ) : null}
+      </div>
+    );
   }
 
   return <p>Running diagnostics ...</p>;
-- 
cgit v1.2.3

