summaryrefslogtreecommitdiff
path: root/src/webex/pages/pay.tsx
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-04-06 23:32:01 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-04-06 23:32:01 +0530
commit47787c0b0b846d5f4a057661efdd05d8786032f1 (patch)
tree3a3d58a5ebad8af584de6a6cd882c2019f71dffa /src/webex/pages/pay.tsx
parentf36bb7a04eabe0330cb166bf9ce5021c92f38dc8 (diff)
downloadwallet-core-47787c0b0b846d5f4a057661efdd05d8786032f1.tar.gz
wallet-core-47787c0b0b846d5f4a057661efdd05d8786032f1.tar.bz2
wallet-core-47787c0b0b846d5f4a057661efdd05d8786032f1.zip
make linter less grumpy
Diffstat (limited to 'src/webex/pages/pay.tsx')
-rw-r--r--src/webex/pages/pay.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/webex/pages/pay.tsx b/src/webex/pages/pay.tsx
index 09aa595c3..e3dd630b6 100644
--- a/src/webex/pages/pay.tsx
+++ b/src/webex/pages/pay.tsx
@@ -34,7 +34,7 @@ import React, { useState, useEffect } from "react";
import * as Amounts from "../../util/amounts";
import { codecForContractTerms, ContractTerms } from "../../types/talerTypes";
-function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
+function TalerPayDialog({ talerPayUri }: { talerPayUri: string }): JSX.Element {
const [payStatus, setPayStatus] = useState<PreparePayResult | undefined>();
const [payErrMsg, setPayErrMsg] = useState<string | undefined>("");
const [numTries, setNumTries] = useState(0);
@@ -42,7 +42,7 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
let totalFees: Amounts.AmountJson | undefined = undefined;
useEffect(() => {
- const doFetch = async () => {
+ const doFetch = async (): Promise<void> => {
const p = await wxApi.preparePay(talerPayUri);
setPayStatus(p);
};
@@ -108,7 +108,7 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
<strong>{renderAmount(Amounts.parseOrThrow(contractTerms.amount))}</strong>
);
- const doPayment = async () => {
+ const doPayment = async (): Promise<void> => {
if (payStatus.status !== "payment-possible") {
throw Error(`invalid state: ${payStatus.status}`);
}
@@ -178,11 +178,11 @@ function TalerPayDialog({ talerPayUri }: { talerPayUri: string }) {
);
}
-export function makePayPage() {
+export function makePayPage(): JSX.Element {
const url = new URL(document.location.href);
const talerPayUri = url.searchParams.get("talerPayUri");
if (!talerPayUri) {
throw Error("invalid parameter");
}
return <TalerPayDialog talerPayUri={talerPayUri} />;
-} \ No newline at end of file
+}