diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src')
21 files changed, 201 insertions, 308 deletions
diff --git a/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.stories.tsx b/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.stories.tsx index 6cf863519..74c92cbc6 100644 --- a/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.stories.tsx +++ b/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.stories.tsx @@ -73,11 +73,11 @@ const cd: WalletContractData = { country: "ar", }, }, - products: [], + // products: [], autoRefund: undefined, summaryI18n: undefined, - deliveryDate: undefined, - deliveryLocation: undefined, + // deliveryDate: undefined, + // deliveryLocation: undefined, }; export const ShowingSimpleOrder = tests.createExample(ShowView, { diff --git a/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx b/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx index 392a7d0e8..db9b6ebcd 100644 --- a/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx +++ b/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx @@ -259,7 +259,7 @@ export function ShowView({ contractTerms, hideHandler }: States.Show): VNode { </span> </td> </tr> - <tr> + {/* <tr> <td> <i18n.Translate>Delivery date</i18n.Translate> </td> @@ -291,7 +291,7 @@ export function ShowView({ contractTerms, hideHandler }: States.Show): VNode { .map((p) => `${p.description} x ${p.quantity}`) .join(", ")} </td> - </tr> + </tr> */} <tr> <td> <i18n.Translate>Created at</i18n.Translate> @@ -334,8 +334,8 @@ export function ShowView({ contractTerms, hideHandler }: States.Show): VNode { !contractTerms.autoRefund ? Duration.getZero() : Duration.fromTalerProtocolDuration( - contractTerms.autoRefund, - ), + contractTerms.autoRefund, + ), )} format="dd MMMM yyyy, HH:mm" /> diff --git a/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx b/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx index 214c4d792..f6c176550 100644 --- a/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx +++ b/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx @@ -99,7 +99,7 @@ export function ShowButtonsNonAcceptedTosView({ </WarningText> </section> )} */} - {terms.status === ExchangeTosStatus.Pending && ( + {terms.status === ExchangeTosStatus.Accepted && ( <section style={{ justifyContent: "space-around", display: "flex" }}> <Button variant="contained" @@ -181,7 +181,7 @@ export function ShowTosContentView({ </LinkSuccess> </section> )} - {termsAccepted && terms.status !== ExchangeTosStatus.Proposed && ( + {termsAccepted && terms.status !== ExchangeTosStatus.Accepted && ( <section style={{ justifyContent: "space-around", display: "flex" }}> <CheckboxOutlined name="terms" diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts index 098f18921..8bae9470f 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts @@ -78,7 +78,7 @@ export function useComponentState({ const { contractTerms, - peerPullPaymentIncomingId, + peerPullDebitId, amountEffective, amountRaw, } = hook.response.p2p; @@ -155,7 +155,7 @@ export function useComponentState({ const resp = await api.wallet.call( WalletApiOperation.ConfirmPeerPullDebit, { - peerPullPaymentIncomingId, + peerPullDebitId, }, ); onSuccess(resp.transactionId); diff --git a/packages/taler-wallet-webextension/src/cta/Payment/views.tsx b/packages/taler-wallet-webextension/src/cta/Payment/views.tsx index 0bdadef0e..c00e570f9 100644 --- a/packages/taler-wallet-webextension/src/cta/Payment/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/Payment/views.tsx @@ -76,7 +76,7 @@ export function BaseView(state: SupportedStates): VNode { ...contractTerms, orderId: contractTerms.order_id, contractTermsHash: "", - products: contractTerms.products!, + // products: contractTerms.products!, }} proposalId={state.payStatus.proposalId} /> diff --git a/packages/taler-wallet-webextension/src/cta/Refund/index.ts b/packages/taler-wallet-webextension/src/cta/Refund/index.ts index bbb72c328..42e9cc534 100644 --- a/packages/taler-wallet-webextension/src/cta/Refund/index.ts +++ b/packages/taler-wallet-webextension/src/cta/Refund/index.ts @@ -49,7 +49,7 @@ export namespace State { interface BaseInfo { merchantName: string; - products: Product[] | undefined; + // products: Product[] | undefined; amount: AmountJson; // awaitingAmount: AmountJson; // granted: AmountJson; diff --git a/packages/taler-wallet-webextension/src/cta/Refund/state.ts b/packages/taler-wallet-webextension/src/cta/Refund/state.ts index 0ba77a19d..6c0f37471 100644 --- a/packages/taler-wallet-webextension/src/cta/Refund/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Refund/state.ts @@ -106,7 +106,7 @@ export function useComponentState({ // granted: Amounts.parseOrThrow(info.response.refund.granted), // awaitingAmount: Amounts.parseOrThrow(refund.awaiting), merchantName: purchase.info.merchant.name, - products: purchase.info.products, + // products: purchase.info.products, error: undefined, }; diff --git a/packages/taler-wallet-webextension/src/cta/Refund/stories.tsx b/packages/taler-wallet-webextension/src/cta/Refund/stories.tsx index ef1f76033..03d55ee91 100644 --- a/packages/taler-wallet-webextension/src/cta/Refund/stories.tsx +++ b/packages/taler-wallet-webextension/src/cta/Refund/stories.tsx @@ -47,7 +47,7 @@ export const Ready = tests.createExample(ReadyView, { // awaitingAmount: Amounts.parseOrThrow("USD:1"), // granted: Amounts.parseOrThrow("USD:0"), merchantName: "the merchant", - products: [], + // products: [], orderId: "abcdef", }); @@ -60,18 +60,18 @@ export const WithAProductList = tests.createExample(ReadyView, { // awaitingAmount: Amounts.parseOrThrow("USD:1"), // granted: Amounts.parseOrThrow("USD:0"), merchantName: "the merchant", - products: [ - { - description: "beer", - image: beer, - quantity: 2, - }, - { - description: "t-shirt", - price: "EUR:1", - quantity: 5, - }, - ], + // products: [ + // { + // description: "beer", + // image: beer, + // quantity: 2, + // }, + // { + // description: "t-shirt", + // price: "EUR:1", + // quantity: 5, + // }, + // ], orderId: "abcdef", }); diff --git a/packages/taler-wallet-webextension/src/cta/Refund/views.tsx b/packages/taler-wallet-webextension/src/cta/Refund/views.tsx index accdab0c3..b6638cf8b 100644 --- a/packages/taler-wallet-webextension/src/cta/Refund/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/Refund/views.tsx @@ -104,11 +104,11 @@ export function ReadyView(state: State.Ready): VNode { kind="positive" /> */} </section> - {state.products && state.products.length ? ( + {/* {state.products && state.products.length ? ( <section> <ProductList products={state.products} /> </section> - ) : undefined} + ) : undefined} */} <section> <Button variant="contained" diff --git a/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts b/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts index dcd41bcc1..77333e15c 100644 --- a/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts +++ b/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts @@ -118,8 +118,8 @@ export function useComponentState({ subject === undefined ? undefined : !subject - ? "Can't be empty" - : undefined, + ? "Can't be empty" + : undefined, value: subject ?? "", onInput: pushAlertOnError(async (e) => setSubject(e)), }, @@ -172,6 +172,10 @@ async function checkPeerPushDebitAndCheckMax( //a good response that allow us to try again throw e; } + if (Amounts.cmp(newAmount, amount) === 1) { + //how can this happen? + throw e; + } return checkPeerPushDebitAndCheckMax(api, Amounts.stringify(newAmount)); } } diff --git a/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts b/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts index fb9acbe83..47c644736 100644 --- a/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts +++ b/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts @@ -58,7 +58,7 @@ export function useComponentState({ const { contractTerms, - peerPushPaymentIncomingId, + peerPushCreditId, amountEffective, amountRaw, } = hook.response; @@ -72,7 +72,7 @@ export function useComponentState({ const resp = await api.wallet.call( WalletApiOperation.ConfirmPeerPushCredit, { - peerPushPaymentIncomingId, + peerPushCreditId, }, ); onSuccess(resp.transactionId); diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts index 72cabe5a4..a3855c2f4 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts @@ -23,7 +23,6 @@ import { ExchangeTosStatus, TalerError, parseWithdrawExchangeUri, - stringifyWithdrawUri, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { useEffect, useState } from "preact/hooks"; diff --git a/packages/taler-wallet-webextension/src/hooks/useDiagnostics.ts b/packages/taler-wallet-webextension/src/hooks/useDiagnostics.ts deleted file mode 100644 index fcd31b3c6..000000000 --- a/packages/taler-wallet-webextension/src/hooks/useDiagnostics.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of GNU Taler - (C) 2022 Taler Systems S.A. - - GNU Taler is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. - - GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - */ - -import { WalletDiagnostics } from "@gnu-taler/taler-util"; -import { useEffect, useState } from "preact/hooks"; -import { useBackendContext } from "../context/backend.js"; - -export function useDiagnostics(): [WalletDiagnostics | undefined, boolean] { - const [timedOut, setTimedOut] = useState(false); - const api = useBackendContext(); - const [diagnostics, setDiagnostics] = useState<WalletDiagnostics | undefined>( - undefined, - ); - - useEffect(() => { - let gotDiagnostics = false; - setTimeout(() => { - if (!gotDiagnostics) { - console.error("timed out"); - setTimedOut(true); - } - }, 1000); - const doFetch = async (): Promise<void> => { - const d = await api.background.call("getDiagnostics", undefined); - gotDiagnostics = true; - setDiagnostics(d); - }; - doFetch(); - }, []); - return [diagnostics, timedOut]; -} diff --git a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx index c5e5c3c07..c972f0919 100644 --- a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx @@ -27,24 +27,21 @@ import { PendingTaskInfo, WalletApiOperation, } from "@gnu-taler/taler-wallet-core"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { format } from "date-fns"; -import { Fragment, h, VNode } from "preact"; +import { Fragment, VNode, h } from "preact"; import { useEffect, useRef, useState } from "preact/hooks"; -import { Diagnostics } from "../components/Diagnostics.js"; import { SelectList } from "../components/SelectList.js"; -import { NotifyUpdateFadeOut } from "../components/styled/index.js"; import { Time } from "../components/Time.js"; +import { NotifyUpdateFadeOut } from "../components/styled/index.js"; import { useBackendContext } from "../context/backend.js"; -import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { useAsyncAsHook } from "../hooks/useAsyncAsHook.js"; -import { useDiagnostics } from "../hooks/useDiagnostics.js"; import { Button } from "../mui/Button.js"; import { Grid } from "../mui/Grid.js"; import { Paper } from "../mui/Paper.js"; import { TextField } from "../mui/TextField.js"; export function DeveloperPage(): VNode { - const [status, timedOut] = useDiagnostics(); const listenAllEvents = Array.from<NotificationType>({ length: 1 }); @@ -73,13 +70,11 @@ export function DeveloperPage(): VNode { response === undefined ? nonResponse : response.hasError - ? nonResponse - : response.response; + ? nonResponse + : response.response; return ( <View - status={status} - timedOut={timedOut} operations={operations} coins={coins} exchanges={exchanges} @@ -108,8 +103,6 @@ type SplitedCoinInfo = { }; export interface Props { - status: any; - timedOut: boolean; operations: PendingTaskInfo[]; coins: CoinsInfo; exchanges: ExchangeListItem[]; @@ -121,8 +114,6 @@ function hashObjectId(o: any): string { } export function View({ - status, - timedOut, operations, coins, onDownloadDatabase, @@ -458,7 +449,6 @@ export function View({ ); })} <br /> - <Diagnostics diagnostics={status} timedOut={timedOut} /> {operations && operations.length > 0 && ( <Fragment> <p> diff --git a/packages/taler-wallet-webextension/src/wallet/ProviderAddPage.tsx b/packages/taler-wallet-webextension/src/wallet/ProviderAddPage.tsx index b32eb831a..6ade0718a 100644 --- a/packages/taler-wallet-webextension/src/wallet/ProviderAddPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/ProviderAddPage.tsx @@ -16,7 +16,6 @@ import { Amounts, - BackupBackupProviderTerms, canonicalizeBaseUrl, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; @@ -41,6 +40,12 @@ interface Props { onBack: () => Promise<void>; } +interface BackupBackupProviderTerms { + annual_fee: string; + storage_limit_in_megabytes: number; + supported_protocol_version: string; +} + export function ProviderAddPage({ onBack }: Props): VNode { const [verifying, setVerifying] = useState< | { url: string; name: string; provider: BackupBackupProviderTerms } diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx index 3ba3ac591..f1ae84ed3 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx @@ -378,9 +378,9 @@ export const PaymentWithDeliveryDate = tests.createExample(TestedComponent, { amountRaw: "KUDOS:12", info: { ...exampleData.payment.info, - delivery_date: { - t_s: new Date().getTime() / 1000, - }, + // delivery_date: { + // t_s: new Date().getTime() / 1000, + // }, }, }, }); @@ -391,12 +391,12 @@ export const PaymentWithDeliveryAddr = tests.createExample(TestedComponent, { amountRaw: "KUDOS:12", info: { ...exampleData.payment.info, - delivery_location: { - country: "Argentina", - street: "Elm Street", - district: "CABA", - post_code: "1101", - }, + // delivery_location: { + // country: "Argentina", + // street: "Elm Street", + // district: "CABA", + // post_code: "1101", + // }, }, }, }); @@ -407,15 +407,15 @@ export const PaymentWithDeliveryFull = tests.createExample(TestedComponent, { amountRaw: "KUDOS:12", info: { ...exampleData.payment.info, - delivery_date: { - t_s: new Date().getTime() / 1000, - }, - delivery_location: { - country: "Argentina", - street: "Elm Street", - district: "CABA", - post_code: "1101", - }, + // delivery_date: { + // t_s: new Date().getTime() / 1000, + // }, + // delivery_location: { + // country: "Argentina", + // street: "Elm Street", + // district: "CABA", + // post_code: "1101", + // }, }, }, }); diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index e54137016..3b76558ce 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -237,8 +237,8 @@ function TransactionTemplate({ <Fragment> <section style={{ padding: 8, textAlign: "center" }}> {transaction?.error && - // FIXME: wallet core should stop sending this error on KYC - transaction.error.code !== + // FIXME: wallet core should stop sending this error on KYC + transaction.error.code !== TalerErrorCode.WALLET_WITHDRAWAL_KYC_REQUIRED ? ( <ErrorAlertView error={alertFromError( @@ -464,7 +464,7 @@ export function TransactionView({ {/**FIXME: DD37 check if this holds */} {transaction.txState.major !== - TransactionMajorState.Pending ? undefined : transaction + TransactionMajorState.Pending ? undefined : transaction .withdrawalDetails.type === WithdrawalType.ManualTransfer ? ( //manual withdrawal <BankDetailsByPaytoType @@ -1073,126 +1073,126 @@ export function MerchantDetails({ ); } -function DeliveryDetails({ - date, - location, -}: { - date: TalerProtocolTimestamp | undefined; - location: Location | undefined; -}): VNode { - const { i18n } = useTranslationContext(); - return ( - <PurchaseDetailsTable> - {location && ( - <Fragment> - {location.country && ( - <tr> - <td> - <i18n.Translate>Country</i18n.Translate> - </td> - <td>{location.country}</td> - </tr> - )} - {location.address_lines && ( - <tr> - <td> - <i18n.Translate>Address lines</i18n.Translate> - </td> - <td>{location.address_lines}</td> - </tr> - )} - {location.building_number && ( - <tr> - <td> - <i18n.Translate>Building number</i18n.Translate> - </td> - <td>{location.building_number}</td> - </tr> - )} - {location.building_name && ( - <tr> - <td> - <i18n.Translate>Building name</i18n.Translate> - </td> - <td>{location.building_name}</td> - </tr> - )} - {location.street && ( - <tr> - <td> - <i18n.Translate>Street</i18n.Translate> - </td> - <td>{location.street}</td> - </tr> - )} - {location.post_code && ( - <tr> - <td> - <i18n.Translate>Post code</i18n.Translate> - </td> - <td>{location.post_code}</td> - </tr> - )} - {location.town_location && ( - <tr> - <td> - <i18n.Translate>Town location</i18n.Translate> - </td> - <td>{location.town_location}</td> - </tr> - )} - {location.town && ( - <tr> - <td> - <i18n.Translate>Town</i18n.Translate> - </td> - <td>{location.town}</td> - </tr> - )} - {location.district && ( - <tr> - <td> - <i18n.Translate>District</i18n.Translate> - </td> - <td>{location.district}</td> - </tr> - )} - {location.country_subdivision && ( - <tr> - <td> - <i18n.Translate>Country subdivision</i18n.Translate> - </td> - <td>{location.country_subdivision}</td> - </tr> - )} - </Fragment> - )} - - {!location || !date ? undefined : ( - <tr> - <td colSpan={2}> - <hr /> - </td> - </tr> - )} - {date && ( - <Fragment> - <tr> - <td> - <i18n.Translate>Date</i18n.Translate> - </td> - <td> - <Time - timestamp={AbsoluteTime.fromProtocolTimestamp(date)} - format="dd MMMM yyyy, HH:mm" - /> - </td> - </tr> - </Fragment> - )} - </PurchaseDetailsTable> - ); -} +// function DeliveryDetails({ +// date, +// location, +// }: { +// date: TalerProtocolTimestamp | undefined; +// location: Location | undefined; +// }): VNode { +// const { i18n } = useTranslationContext(); +// return ( +// <PurchaseDetailsTable> +// {location && ( +// <Fragment> +// {location.country && ( +// <tr> +// <td> +// <i18n.Translate>Country</i18n.Translate> +// </td> +// <td>{location.country}</td> +// </tr> +// )} +// {location.address_lines && ( +// <tr> +// <td> +// <i18n.Translate>Address lines</i18n.Translate> +// </td> +// <td>{location.address_lines}</td> +// </tr> +// )} +// {location.building_number && ( +// <tr> +// <td> +// <i18n.Translate>Building number</i18n.Translate> +// </td> +// <td>{location.building_number}</td> +// </tr> +// )} +// {location.building_name && ( +// <tr> +// <td> +// <i18n.Translate>Building name</i18n.Translate> +// </td> +// <td>{location.building_name}</td> +// </tr> +// )} +// {location.street && ( +// <tr> +// <td> +// <i18n.Translate>Street</i18n.Translate> +// </td> +// <td>{location.street}</td> +// </tr> +// )} +// {location.post_code && ( +// <tr> +// <td> +// <i18n.Translate>Post code</i18n.Translate> +// </td> +// <td>{location.post_code}</td> +// </tr> +// )} +// {location.town_location && ( +// <tr> +// <td> +// <i18n.Translate>Town location</i18n.Translate> +// </td> +// <td>{location.town_location}</td> +// </tr> +// )} +// {location.town && ( +// <tr> +// <td> +// <i18n.Translate>Town</i18n.Translate> +// </td> +// <td>{location.town}</td> +// </tr> +// )} +// {location.district && ( +// <tr> +// <td> +// <i18n.Translate>District</i18n.Translate> +// </td> +// <td>{location.district}</td> +// </tr> +// )} +// {location.country_subdivision && ( +// <tr> +// <td> +// <i18n.Translate>Country subdivision</i18n.Translate> +// </td> +// <td>{location.country_subdivision}</td> +// </tr> +// )} +// </Fragment> +// )} + +// {!location || !date ? undefined : ( +// <tr> +// <td colSpan={2}> +// <hr /> +// </td> +// </tr> +// )} +// {date && ( +// <Fragment> +// <tr> +// <td> +// <i18n.Translate>Date</i18n.Translate> +// </td> +// <td> +// <Time +// timestamp={AbsoluteTime.fromProtocolTimestamp(date)} +// format="dd MMMM yyyy, HH:mm" +// /> +// </td> +// </tr> +// </Fragment> +// )} +// </PurchaseDetailsTable> +// ); +// } export function ExchangeDetails({ exchange }: { exchange: string }): VNode { return ( @@ -1475,10 +1475,10 @@ export function PurchaseDetails({ const total = Amounts.add(price.value, price.fee).amount; - const hasProducts = info.products && info.products.length > 0; + // const hasProducts = info.products && info.products.length > 0; - const hasShipping = - info.delivery_date !== undefined || info.delivery_location !== undefined; + // const hasShipping = + // info.delivery_date !== undefined || info.delivery_location !== undefined; const showLargePic = (): void => { return; @@ -1558,7 +1558,7 @@ export function PurchaseDetails({ </tr> </Fragment> )} - {hasProducts && ( + {/* {hasProducts && ( <tr> <td colSpan={2}> <PartCollapsible @@ -1586,8 +1586,8 @@ export function PurchaseDetails({ /> </td> </tr> - )} - {hasShipping && ( + )} */} + {/* {hasShipping && ( <tr> <td colSpan={2}> <PartCollapsible @@ -1602,7 +1602,7 @@ export function PurchaseDetails({ /> </td> </tr> - )} + )} */} <tr> <td> <ShowFullContractTermPopup proposalId={proposalId} /> @@ -2008,7 +2008,7 @@ function ShowWithdrawalDetailForBankIntegrated({ /> )} {!transaction.withdrawalDetails.confirmed && - transaction.withdrawalDetails.bankConfirmationUrl ? ( + transaction.withdrawalDetails.bankConfirmationUrl ? ( <InfoBox> <div style={{ display: "block" }}> <i18n.Translate> diff --git a/packages/taler-wallet-webextension/src/wallet/Welcome.stories.tsx b/packages/taler-wallet-webextension/src/wallet/Welcome.stories.tsx index 2cf28b611..dfce1c14b 100644 --- a/packages/taler-wallet-webextension/src/wallet/Welcome.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Welcome.stories.tsx @@ -29,17 +29,9 @@ export default { export const Normal = tests.createExample(TestedComponent, { permissionToggle: { value: true, button: {} }, - diagnostics: { - errors: [], - walletManifestVersion: "1.0", - walletManifestDisplayVersion: "1.0", - firefoxIdbProblem: false, - dbOutdated: false, - }, }); export const TimedoutDiagnostics = tests.createExample(TestedComponent, { - timedOut: true, permissionToggle: { value: true, button: {} }, }); diff --git a/packages/taler-wallet-webextension/src/wallet/Welcome.tsx b/packages/taler-wallet-webextension/src/wallet/Welcome.tsx index 8d348ca9d..e19152be2 100644 --- a/packages/taler-wallet-webextension/src/wallet/Welcome.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Welcome.tsx @@ -25,7 +25,6 @@ import { Fragment, h, VNode } from "preact"; import { Checkbox } from "../components/Checkbox.js"; import { SubTitle, Title } from "../components/styled/index.js"; import { useTranslationContext } from "@gnu-taler/web-util/browser"; -import { useDiagnostics } from "../hooks/useDiagnostics.js"; import { useSettings } from "../hooks/useSettings.js"; import { ToggleHandler } from "../mui/handlers.js"; import { platform } from "../platform/foreground.js"; @@ -34,7 +33,6 @@ import { useAlertContext } from "../context/alert.js"; export function WelcomePage(): VNode { const [settings, updateSettings] = useSettings(); const { safely } = useAlertContext(); - const [diagnostics, timedOut] = useDiagnostics(); return ( <View permissionToggle={{ @@ -45,21 +43,15 @@ export function WelcomePage(): VNode { ), }, }} - diagnostics={diagnostics} - timedOut={timedOut} /> ); } export interface ViewProps { permissionToggle: ToggleHandler; - diagnostics: WalletDiagnostics | undefined; - timedOut: boolean; } export function View({ permissionToggle, - diagnostics, - timedOut, }: ViewProps): VNode { const { i18n } = useTranslationContext(); return ( diff --git a/packages/taler-wallet-webextension/src/wxApi.ts b/packages/taler-wallet-webextension/src/wxApi.ts index 46c9f1b2d..004faad5c 100644 --- a/packages/taler-wallet-webextension/src/wxApi.ts +++ b/packages/taler-wallet-webextension/src/wxApi.ts @@ -70,10 +70,6 @@ export interface BackgroundOperations { request: void; response: void; }; - getDiagnostics: { - request: void; - response: WalletDiagnostics; - }; runGarbageCollector: { request: void; response: void; diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts b/packages/taler-wallet-webextension/src/wxBackend.ts index e7385abe5..40b7077af 100644 --- a/packages/taler-wallet-webextension/src/wxBackend.ts +++ b/packages/taler-wallet-webextension/src/wxBackend.ts @@ -51,14 +51,11 @@ import { importDb, openPromise, } from "@gnu-taler/taler-wallet-core"; -import { - MessageFromBackend, - MessageFromFrontend, - MessageResponse, -} from "./platform/api.js"; +import { MessageFromFrontend, MessageResponse } from "./platform/api.js"; import { platform } from "./platform/background.js"; import { ExtensionOperations } from "./taler-wallet-interaction-loader.js"; import { BackgroundOperations } from "./wxApi.js"; +import { HttpRequestLibrary } from "@gnu-taler/taler-util/http"; /** * Currently active wallet instance. Might be unloaded and @@ -79,43 +76,6 @@ const walletInit: OpenedPromise<void> = openPromise<void>(); const logger = new Logger("wxBackend.ts"); -async function getDiagnostics(): Promise<WalletDiagnostics> { - const manifestData = platform.getWalletWebExVersion(); - const errors: string[] = []; - let firefoxIdbProblem = false; - let dbOutdated = false; - try { - await walletInit.promise; - } catch (e) { - errors.push("Error during wallet initialization: " + e); - if ( - currentDatabase === undefined && - outdatedDbVersion === undefined && - platform.isFirefox() - ) { - firefoxIdbProblem = true; - } - } - if (!currentWallet) { - errors.push("Could not create wallet backend."); - } - if (!currentDatabase) { - errors.push("Could not open database"); - } - if (outdatedDbVersion !== undefined) { - errors.push(`Outdated DB version: ${outdatedDbVersion}`); - dbOutdated = true; - } - const diagnostics: WalletDiagnostics = { - walletManifestDisplayVersion: manifestData.version_name || "(undefined)", - walletManifestVersion: manifestData.version, - errors, - firefoxIdbProblem, - dbOutdated, - }; - return diagnostics; -} - type BackendHandlerType = { [Op in keyof BackgroundOperations]: ( req: BackgroundOperations[Op]["request"], @@ -175,7 +135,6 @@ async function isInjectionEnabled(): Promise<boolean> { const backendHandlers: BackendHandlerType = { freeze, sum, - getDiagnostics, resetDb, runGarbageCollector, setLoggingLevel, @@ -297,7 +256,7 @@ async function reinitWallet(): Promise<void> { } currentDatabase = undefined; // setBadgeText({ text: "" }); - let httpLib; + let httpLib: HttpRequestLibrary; let cryptoWorker; let timer; @@ -318,7 +277,7 @@ async function reinitWallet(): Promise<void> { logger.info("Setting up wallet"); const wallet = await Wallet.create( indexedDB as any, - httpLib, + httpLib as any, timer, cryptoWorker, { |