From 505eb07d8e42d6787dc23b2024b76e05f807e1ad Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Mon, 6 Dec 2021 10:31:19 -0300
Subject: show error details in devmode

---
 .../src/components/ErrorTalerOperation.tsx                        | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

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

diff --git a/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx b/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx
index 4aaf4a5be..2f50fda2f 100644
--- a/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx
+++ b/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx
@@ -17,6 +17,7 @@ import { TalerErrorDetails } from "@gnu-taler/taler-util";
 import { VNode, h, Fragment } from "preact";
 import { useState } from "preact/hooks";
 import arrowDown from "../../static/img/chevron-down.svg";
+import { useDevContext } from "../context/devContext";
 import { ErrorBox } from "./styled";
 
 export function ErrorTalerOperation({
@@ -26,8 +27,8 @@ export function ErrorTalerOperation({
   title?: string;
   error?: TalerErrorDetails;
 }): VNode | null {
+  const { devMode } = useDevContext();
   const [showErrorDetail, setShowErrorDetail] = useState(false);
-  const [showExtraInfo, setShowExtraInfo] = useState(false);
   if (!title || !error) return null;
   return (
     <ErrorBox style={{ paddingTop: 0, paddingBottom: 0 }}>
@@ -47,11 +48,8 @@ export function ErrorTalerOperation({
         <Fragment>
           <div style={{ padding: 5, textAlign: "left" }}>
             <div>{error.message}</div>
-            <a href="#" onClick={() => setShowExtraInfo((v) => !v)}>
-              more
-            </a>
           </div>
-          {showExtraInfo && (
+          {devMode && (
             <div style={{ textAlign: "left", overflowX: "auto" }}>
               <pre>{JSON.stringify(error, undefined, 2)}</pre>
             </div>
-- 
cgit v1.2.3

