summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/components
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2021-12-06 10:31:19 -0300
committerSebastian <sebasjm@gmail.com>2021-12-06 10:31:26 -0300
commit505eb07d8e42d6787dc23b2024b76e05f807e1ad (patch)
tree3014f55b6d7074faacdd72beb8ba67313dc0ae5c /packages/taler-wallet-webextension/src/components
parentc3b01ad9e4ccd49407a8df7aafce61909291a1b9 (diff)
downloadwallet-core-505eb07d8e42d6787dc23b2024b76e05f807e1ad.tar.gz
wallet-core-505eb07d8e42d6787dc23b2024b76e05f807e1ad.tar.bz2
wallet-core-505eb07d8e42d6787dc23b2024b76e05f807e1ad.zip
show error details in devmode
Diffstat (limited to 'packages/taler-wallet-webextension/src/components')
-rw-r--r--packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx8
1 files changed, 3 insertions, 5 deletions
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>