diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet')
10 files changed, 49 insertions, 46 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx b/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx index 0a39b2777..8a3710f69 100644 --- a/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/BackupPage.tsx @@ -121,6 +121,7 @@ export function BackupPage({ onAddProvider }: Props): VNode { return ( <ErrorAlertView error={alertFromError( + i18n, i18n.str`Could not load backup providers`, status, )} diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage/state.ts b/packages/taler-wallet-webextension/src/wallet/DepositPage/state.ts index 8c773186e..97b2ab517 100644 --- a/packages/taler-wallet-webextension/src/wallet/DepositPage/state.ts +++ b/packages/taler-wallet-webextension/src/wallet/DepositPage/state.ts @@ -60,8 +60,8 @@ export function useComponentState({ parsed !== undefined ? parsed : currency !== undefined - ? Amounts.zeroOfCurrency(currency) - : undefined; + ? Amounts.zeroOfCurrency(currency) + : undefined; // const [accountIdx, setAccountIdx] = useState<number>(0); const [selectedAccount, setSelectedAccount] = useState<PaytoUri>(); @@ -83,7 +83,8 @@ export function useComponentState({ if (hook.hasError) { return { status: "error", - error: alertFromError(i18n.str`Could not load balance information`, hook), + error: alertFromError(i18n, + i18n.str`Could not load balance information`, hook), }; } const { accounts, balances } = hook.response; @@ -169,6 +170,7 @@ export function useComponentState({ return { status: "error", error: alertFromError( + i18n, i18n.str`Could not load fee for amount ${amountStr}`, hook, ), @@ -193,8 +195,8 @@ export function useComponentState({ const amountError = !isDirty ? undefined : Amounts.cmp(balance, amount) === -1 - ? `Too much, your current balance is ${Amounts.stringifyValue(balance)}` - : undefined; + ? `Too much, your current balance is ${Amounts.stringifyValue(balance)}` + : undefined; const unableToDeposit = Amounts.isZero(totalToDeposit) || //deposit may be zero because of fee diff --git a/packages/taler-wallet-webextension/src/wallet/DestinationSelection/state.ts b/packages/taler-wallet-webextension/src/wallet/DestinationSelection/state.ts index a5d44e872..d4e270a6c 100644 --- a/packages/taler-wallet-webextension/src/wallet/DestinationSelection/state.ts +++ b/packages/taler-wallet-webextension/src/wallet/DestinationSelection/state.ts @@ -52,22 +52,22 @@ export function useComponentState(props: Props): RecursiveState<State> { const previous: Contact[] = true ? [] : [ - { - name: "International Bank", - icon_type: "bank", - description: "account ending with 3454", - }, - { - name: "Max", - icon_type: "bank", - description: "account ending with 3454", - }, - { - name: "Alex", - icon_type: "bank", - description: "account ending with 3454", - }, - ]; + { + name: "International Bank", + icon_type: "bank", + description: "account ending with 3454", + }, + { + name: "Max", + icon_type: "bank", + description: "account ending with 3454", + }, + { + name: "Alex", + icon_type: "bank", + description: "account ending with 3454", + }, + ]; if (!amount) { return () => { @@ -87,7 +87,8 @@ export function useComponentState(props: Props): RecursiveState<State> { if (hook.hasError) { return { status: "error", - error: alertFromError(i18n.str`Could not load exchanges`, hook), + error: alertFromError(i18n, + i18n.str`Could not load exchanges`, hook), }; } const currencies: Record<string, string> = {}; @@ -127,8 +128,8 @@ export function useComponentState(props: Props): RecursiveState<State> { onClick: invalid ? undefined : pushAlertOnError(async () => { - props.goToWalletBankDeposit(currencyAndAmount); - }), + props.goToWalletBankDeposit(currencyAndAmount); + }), }, selectMax: { onClick: pushAlertOnError(async () => { @@ -145,8 +146,8 @@ export function useComponentState(props: Props): RecursiveState<State> { onClick: invalid ? undefined : pushAlertOnError(async () => { - props.goToWalletWalletSend(currencyAndAmount); - }), + props.goToWalletWalletSend(currencyAndAmount); + }), }, amountHandler: { onInput: pushAlertOnError(async (s) => setAmount(s)), @@ -168,22 +169,22 @@ export function useComponentState(props: Props): RecursiveState<State> { onClick: invalid ? undefined : pushAlertOnError(async () => { - props.goToWalletManualWithdraw(currencyAndAmount); - }), + props.goToWalletManualWithdraw(currencyAndAmount); + }), }, goToBank: { onClick: invalid ? undefined : pushAlertOnError(async () => { - props.goToWalletManualWithdraw(currencyAndAmount); - }), + props.goToWalletManualWithdraw(currencyAndAmount); + }), }, goToWallet: { onClick: invalid ? undefined : pushAlertOnError(async () => { - props.goToWalletWalletInvoice(currencyAndAmount); - }), + props.goToWalletWalletInvoice(currencyAndAmount); + }), }, amountHandler: { onInput: pushAlertOnError(async (s) => setAmount(s)), diff --git a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts index db88dc94e..d70b62de0 100644 --- a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts +++ b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts @@ -90,6 +90,7 @@ export function useComponentState({ return { status: "error", error: alertFromError( + i18n, i18n.str`Could not load exchange details info`, hook, ), diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx b/packages/taler-wallet-webextension/src/wallet/History.tsx index 58a437c92..233bd8f28 100644 --- a/packages/taler-wallet-webextension/src/wallet/History.tsx +++ b/packages/taler-wallet-webextension/src/wallet/History.tsx @@ -87,6 +87,7 @@ export function HistoryPage({ return ( <ErrorAlertView error={alertFromError( + i18n, i18n.str`Could not load the list of transactions`, state, )} diff --git a/packages/taler-wallet-webextension/src/wallet/ManageAccount/state.ts b/packages/taler-wallet-webextension/src/wallet/ManageAccount/state.ts index 769fe4d10..a7b2fe90f 100644 --- a/packages/taler-wallet-webextension/src/wallet/ManageAccount/state.ts +++ b/packages/taler-wallet-webextension/src/wallet/ManageAccount/state.ts @@ -61,7 +61,10 @@ export function useComponentState({ if (hook.hasError) { return { status: "error", - error: alertFromError(i18n.str`Could not load known bank accounts`, hook), + error: alertFromError( + i18n, + i18n.str`Could not load known bank accounts`, + hook), }; } diff --git a/packages/taler-wallet-webextension/src/wallet/Notifications/state.ts b/packages/taler-wallet-webextension/src/wallet/Notifications/state.ts index f19fe260d..3ef8250ac 100644 --- a/packages/taler-wallet-webextension/src/wallet/Notifications/state.ts +++ b/packages/taler-wallet-webextension/src/wallet/Notifications/state.ts @@ -42,6 +42,7 @@ export function useComponentState(p: Props): State { return { status: "error", error: alertFromError( + i18n, i18n.str`Could not load user attention request`, hook, ), diff --git a/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx b/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx index 5bd90c69b..d628b68e8 100644 --- a/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/ProviderDetailPage.tsx @@ -68,6 +68,7 @@ export function ProviderDetailPage({ return ( <ErrorAlertView error={alertFromError( + i18n, i18n.str`There was an error loading the provider detail for "${providerURL}"`, state, )} diff --git a/packages/taler-wallet-webextension/src/wallet/Settings.tsx b/packages/taler-wallet-webextension/src/wallet/Settings.tsx index e35e6d241..34dd24cea 100644 --- a/packages/taler-wallet-webextension/src/wallet/Settings.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Settings.tsx @@ -15,31 +15,21 @@ */ import { - AbsoluteTime, - ExchangeDetailedResponse, - ExchangeListItem, - ExchangeTosStatus, LibtoolVersion, - ScopeType, TranslatedString, - WalletCoreVersion, + WalletCoreVersion } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { useApiContext, useTranslationContext } from "@gnu-taler/web-util/browser"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; -import { Pages } from "../NavigationBar.js"; import { Checkbox } from "../components/Checkbox.js"; import { EnabledBySettings } from "../components/EnabledBySettings.js"; import { Part } from "../components/Part.js"; import { SelectList } from "../components/SelectList.js"; import { - DestructiveText, Input, - LinkPrimary, SubTitle, - SuccessText, - WarningBox, - WarningText, + WarningBox } from "../components/styled/index.js"; import { useAlertContext } from "../context/alert.js"; import { useBackendContext } from "../context/backend.js"; diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index b77b577eb..10ca67663 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -107,6 +107,7 @@ export function TransactionPage({ tid, goToWalletHistory }: Props): VNode { return ( <ErrorAlertView error={alertFromError( + i18n, i18n.str`Could not load transaction information`, state, )} @@ -234,6 +235,7 @@ function TransactionTemplate({ TalerErrorCode.WALLET_WITHDRAWAL_KYC_REQUIRED ? ( <ErrorAlertView error={alertFromError( + i18n, i18n.str`There was an error trying to complete the transaction`, transaction.error, )} |