aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/cta/Refund.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2021-11-16 13:59:53 -0300
committerSebastian <sebasjm@gmail.com>2021-11-16 14:01:38 -0300
commita994009d2f094c4d9c12da68dac3abb28bdef4b3 (patch)
treee403a58663f81889982635ffb324f9739e6976b3 /packages/taler-wallet-webextension/src/cta/Refund.tsx
parentc33ed919719845f518d6491ef37df6ae16820dd0 (diff)
reserveCreated new design
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Refund.tsx')
-rw-r--r--packages/taler-wallet-webextension/src/cta/Refund.tsx20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Refund.tsx b/packages/taler-wallet-webextension/src/cta/Refund.tsx
index aa11dca6a..cecd1ac00 100644
--- a/packages/taler-wallet-webextension/src/cta/Refund.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Refund.tsx
@@ -20,12 +20,11 @@
* @author Florian Dold
*/
-import * as wxApi from "../wxApi";
-import { AmountView } from "../renderHtml";
-import { ApplyRefundResponse, Amounts } from "@gnu-taler/taler-util";
+import { Amounts, ApplyRefundResponse } from "@gnu-taler/taler-util";
+import { h, VNode } from "preact";
import { useEffect, useState } from "preact/hooks";
-import { JSX } from "preact/jsx-runtime";
-import { h } from "preact";
+import { AmountView } from "../renderHtml";
+import * as wxApi from "../wxApi";
interface Props {
talerRefundUri?: string;
@@ -33,7 +32,7 @@ interface Props {
export interface ViewProps {
applyResult: ApplyRefundResponse;
}
-export function View({ applyResult }: ViewProps) {
+export function View({ applyResult }: ViewProps): VNode {
return (
<section class="main">
<h1>GNU Taler Wallet</h1>
@@ -58,7 +57,7 @@ export function View({ applyResult }: ViewProps) {
</section>
);
}
-export function RefundPage({ talerRefundUri }: Props): JSX.Element {
+export function RefundPage({ talerRefundUri }: Props): VNode {
const [applyResult, setApplyResult] = useState<
ApplyRefundResponse | undefined
>(undefined);
@@ -71,9 +70,10 @@ export function RefundPage({ talerRefundUri }: Props): JSX.Element {
const result = await wxApi.applyRefund(talerRefundUri);
setApplyResult(result);
} catch (e) {
- console.error(e);
- setErrMsg(e.message);
- console.log("err message", e.message);
+ if (e instanceof Error) {
+ setErrMsg(e.message);
+ console.log("err message", e.message);
+ }
}
};
doFetch();