diff options
author | Sebastian <sebasjm@gmail.com> | 2024-06-17 15:55:19 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-06-17 15:55:19 -0300 |
commit | ea870c419d0026177f992f518220b2578dd7040b (patch) | |
tree | e9aa21e5f32dce0b37d218cd4c8a7b7a89164f59 /packages/taler-wallet-webextension/src/cta | |
parent | b62e86aec6041cba287f0f455ffe5c9a50eaac75 (diff) | |
download | wallet-core-ea870c419d0026177f992f518220b2578dd7040b.tar.xz |
fix #8921
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta')
8 files changed, 37 insertions, 7 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/index.ts b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/index.ts index fd3fb52f8..1ca7481be 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/index.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/index.ts @@ -47,6 +47,7 @@ export namespace State { export interface LoadingUriError { status: "error"; + retry: ButtonHandler; error: ErrorAlert; } diff --git a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts index daa3ee76d..baaa9a3dd 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/state.ts @@ -34,6 +34,7 @@ export function useComponentState({ }: Props): RecursiveState<State> { const amount = Amounts.parseOrThrow(amountStr); const api = useBackendContext(); + const { pushAlertOnError } = useAlertContext(); const hook = useAsyncAsHook(() => api.wallet.call(WalletApiOperation.ListExchanges, {}), @@ -49,6 +50,11 @@ export function useComponentState({ if (hook.hasError) { return { status: "error", + retry: { + onClick: pushAlertOnError(async () => { + hook.retry(); + }), + }, error: alertFromError( i18n, i18n.str`Could not load the list of exchanges`, @@ -103,6 +109,11 @@ export function useComponentState({ if (hook.hasError) { return { status: "error", + retry: { + onClick: pushAlertOnError(async () => { + hook.retry(); + }), + }, error: alertFromError( i18n, i18n.str`Could not load the invoice status`, diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts b/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts index f0cd63fbe..dcb1f827b 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts @@ -50,6 +50,7 @@ export namespace State { export interface LoadingUriError { status: "error"; + retry: ButtonHandler; error: ErrorAlert; } diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts index 99de03d2d..deee83751 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts @@ -63,6 +63,11 @@ export function useComponentState({ if (hook.hasError) { return { status: "error", + retry: { + onClick: pushAlertOnError(async () => { + hook.retry(); + }), + }, error: alertFromError( i18n, i18n.str`Could not load the transfer payment status`, diff --git a/packages/taler-wallet-webextension/src/cta/TransferCreate/index.ts b/packages/taler-wallet-webextension/src/cta/TransferCreate/index.ts index 794d2ad1c..539ca207c 100644 --- a/packages/taler-wallet-webextension/src/cta/TransferCreate/index.ts +++ b/packages/taler-wallet-webextension/src/cta/TransferCreate/index.ts @@ -14,7 +14,11 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { AmountJson, AmountString, TalerErrorDetail } from "@gnu-taler/taler-util"; +import { + AmountJson, + AmountString, + TalerErrorDetail, +} from "@gnu-taler/taler-util"; import { ErrorAlertView } from "../../components/CurrentAlerts.js"; import { Loading } from "../../components/Loading.js"; import { ErrorAlert } from "../../context/alert.js"; @@ -39,6 +43,7 @@ export namespace State { export interface LoadingUriError { status: "error"; + retry: ButtonHandler; error: ErrorAlert; } diff --git a/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts b/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts index f092801ed..f15d48c23 100644 --- a/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts +++ b/packages/taler-wallet-webextension/src/cta/TransferCreate/state.ts @@ -57,6 +57,11 @@ export function useComponentState({ if (hook.hasError) { return { status: "error", + retry: { + onClick: pushAlertOnError(async () => { + hook.retry(); + }), + }, error: alertFromError( i18n, i18n.str`Could not load the max amount to transfer`, diff --git a/packages/taler-wallet-webextension/src/cta/TransferPickup/index.ts b/packages/taler-wallet-webextension/src/cta/TransferPickup/index.ts index 4e1301d6a..a7bb0b67a 100644 --- a/packages/taler-wallet-webextension/src/cta/TransferPickup/index.ts +++ b/packages/taler-wallet-webextension/src/cta/TransferPickup/index.ts @@ -14,16 +14,12 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { - AbsoluteTime, - AmountJson, - TalerErrorDetail, -} from "@gnu-taler/taler-util"; +import { AbsoluteTime, AmountJson } from "@gnu-taler/taler-util"; import { ErrorAlertView } from "../../components/CurrentAlerts.js"; import { Loading } from "../../components/Loading.js"; import { ErrorAlert } from "../../context/alert.js"; import { ButtonHandler } from "../../mui/handlers.js"; -import { compose, StateViewMap } from "../../utils/index.js"; +import { StateViewMap, compose } from "../../utils/index.js"; import { useComponentState } from "./state.js"; import { ReadyView } from "./views.js"; @@ -43,6 +39,7 @@ export namespace State { export interface LoadingUriError { status: "error"; + retry: ButtonHandler; error: ErrorAlert; } diff --git a/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts b/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts index 67f6d9113..28d8c9e70 100644 --- a/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts +++ b/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts @@ -49,6 +49,11 @@ export function useComponentState({ if (hook.hasError) { return { status: "error", + retry: { + onClick: pushAlertOnError(async () => { + hook.retry(); + }), + }, error: alertFromError( i18n, i18n.str`Could not load the invoice payment status`, |