diff options
author | Sebastian <sebasjm@gmail.com> | 2022-11-24 23:16:01 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-11-24 23:16:01 -0300 |
commit | e05ba843a061c8050648ce922f36ed3d8e1cf24a (patch) | |
tree | 4daf3eccc5f2976b980e884499a756cc6f864c6e /packages/taler-wallet-webextension/src/cta/Payment/views.tsx | |
parent | 88618df7b870732f4f29a80686dd4f4cf20887f8 (diff) | |
download | wallet-core-e05ba843a061c8050648ce922f36ed3d8e1cf24a.tar.xz |
fix 7465
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Payment/views.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Payment/views.tsx | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Payment/views.tsx b/packages/taler-wallet-webextension/src/cta/Payment/views.tsx index d9b6eaa02..6b502a87f 100644 --- a/packages/taler-wallet-webextension/src/cta/Payment/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/Payment/views.tsx @@ -26,6 +26,7 @@ import { import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; import { Amount } from "../../components/Amount.js"; +import { ErrorMessage } from "../../components/ErrorMessage.js"; import { LoadingError } from "../../components/LoadingError.js"; import { LogoHeader } from "../../components/LogoHeader.js"; import { Part } from "../../components/Part.js"; @@ -43,6 +44,7 @@ import { Time } from "../../components/Time.js"; import { useTranslationContext } from "../../context/translation.js"; import { Button } from "../../mui/Button.js"; import { ButtonHandler } from "../../mui/handlers.js"; +import { assertUnreachable } from "../../utils/index.js"; import { MerchantDetails, PurchaseDetails } from "../../wallet/Transaction.js"; import { State } from "./index.js"; @@ -63,8 +65,24 @@ type SupportedStates = | State.NoBalanceForCurrency | State.NoEnoughBalance; +export function LostView(state: State.Lost): VNode { + const { i18n } = useTranslationContext(); + + return ( + <ErrorMessage + title={<i18n.Translate>Could not load pay status</i18n.Translate>} + description={ + <i18n.Translate> + The proposal was lost, another should be downloaded + </i18n.Translate> + } + /> + ); +} + export function BaseView(state: SupportedStates): VNode { const { i18n } = useTranslationContext(); + const contractTerms: ContractTerms = state.payStatus.contractTerms; const price = { @@ -399,8 +417,9 @@ export function ButtonsSection({ </Fragment> ); } + if (payStatus.status === PreparePayResultType.Lost) { + return <Fragment />; + } - const error: never = payStatus; - - return <Fragment />; + assertUnreachable(payStatus); } |