From 4365cd6401713b2e207d8c032c0558487e860154 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 28 Jul 2020 14:22:35 +0530 Subject: towards the new withdrawal API (temporarily breaks WebExtension wallet) --- src/webex/pages/withdraw.tsx | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'src/webex/pages') diff --git a/src/webex/pages/withdraw.tsx b/src/webex/pages/withdraw.tsx index 0216cdb4f..4a92704b3 100644 --- a/src/webex/pages/withdraw.tsx +++ b/src/webex/pages/withdraw.tsx @@ -23,20 +23,17 @@ import * as i18n from "../i18n"; -import { WithdrawalDetailsResponse } from "../../types/walletTypes"; - import { WithdrawDetailView, renderAmount } from "../renderHtml"; import React, { useState, useEffect } from "react"; import { - getWithdrawDetails, acceptWithdrawal, onUpdateNotification, } from "../wxApi"; function WithdrawalDialog(props: { talerWithdrawUri: string }): JSX.Element { const [details, setDetails] = useState< - WithdrawalDetailsResponse | undefined + any | undefined >(); const [selectedExchange, setSelectedExchange] = useState< string | undefined @@ -57,24 +54,25 @@ function WithdrawalDialog(props: { talerWithdrawUri: string }): JSX.Element { useEffect(() => { const fetchData = async (): Promise => { - console.log("getting from", talerWithdrawUri); - let d: WithdrawalDetailsResponse | undefined = undefined; - try { - d = await getWithdrawDetails(talerWithdrawUri, selectedExchange); - } catch (e) { - console.error( - `error getting withdraw details for uri ${talerWithdrawUri}, exchange ${selectedExchange}`, - e, - ); - setErrMsg(e.message); - return; - } - console.log("got withdrawDetails", d); - if (!selectedExchange && d.bankWithdrawDetails.suggestedExchange) { - console.log("setting selected exchange"); - setSelectedExchange(d.bankWithdrawDetails.suggestedExchange); - } - setDetails(d); + // FIXME: re-implement with new API + // console.log("getting from", talerWithdrawUri); + // let d: WithdrawalDetailsResponse | undefined = undefined; + // try { + // d = await getWithdrawDetails(talerWithdrawUri, selectedExchange); + // } catch (e) { + // console.error( + // `error getting withdraw details for uri ${talerWithdrawUri}, exchange ${selectedExchange}`, + // e, + // ); + // setErrMsg(e.message); + // return; + // } + // console.log("got withdrawDetails", d); + // if (!selectedExchange && d.bankWithdrawDetails.suggestedExchange) { + // console.log("setting selected exchange"); + // setSelectedExchange(d.bankWithdrawDetails.suggestedExchange); + // } + // setDetails(d); }; fetchData(); }, [selectedExchange, errMsg, selecting, talerWithdrawUri, updateCounter]); -- cgit v1.2.3