diff options
Diffstat (limited to 'packages/taler-wallet-webextension')
3 files changed, 2 insertions, 37 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Payment/index.ts b/packages/taler-wallet-webextension/src/cta/Payment/index.ts index 80822b381..9bca8f74f 100644 --- a/packages/taler-wallet-webextension/src/cta/Payment/index.ts +++ b/packages/taler-wallet-webextension/src/cta/Payment/index.ts @@ -27,7 +27,7 @@ import { ButtonHandler } from "../../mui/handlers.js"; import { compose, StateViewMap } from "../../utils/index.js"; import { wxApi } from "../../wxApi.js"; import { useComponentState } from "./state.js"; -import { BaseView, LoadingUriView, LostView } from "./views.js"; +import { BaseView, LoadingUriView } from "./views.js"; export interface Props { talerPayUri?: string; @@ -41,7 +41,6 @@ export type State = | State.LoadingUriError | State.Ready | State.NoEnoughBalance - | State.Lost | State.NoBalanceForCurrency | State.Confirmed; @@ -64,10 +63,7 @@ export namespace State { } export interface NoBalanceForCurrency extends BaseInfo { status: "no-balance-for-currency"; - payStatus: - | PreparePayResultInsufficientBalance - | PreparePayResultPaymentPossible - | PreparePayResultAlreadyConfirmed; + payStatus: PreparePayResult; balance: undefined; } export interface NoEnoughBalance extends BaseInfo { @@ -82,11 +78,6 @@ export namespace State { balance: AmountJson; } - export interface Lost { - status: "lost"; - error: undefined; - } - export interface Confirmed extends BaseInfo { status: "confirmed"; payStatus: PreparePayResultAlreadyConfirmed; @@ -99,7 +90,6 @@ const viewMapping: StateViewMap<State> = { "loading-uri": LoadingUriView, "no-balance-for-currency": BaseView, "no-enough-balance": BaseView, - lost: LostView, confirmed: BaseView, ready: BaseView, }; diff --git a/packages/taler-wallet-webextension/src/cta/Payment/state.ts b/packages/taler-wallet-webextension/src/cta/Payment/state.ts index b90b1e495..970af5b81 100644 --- a/packages/taler-wallet-webextension/src/cta/Payment/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Payment/state.ts @@ -83,13 +83,6 @@ export function useComponentState( } const { payStatus } = hook.response; - if (payStatus.status === PreparePayResultType.Lost) { - return { - status: "lost", - error: undefined, - }; - } - const amount = Amounts.parseOrThrow(payStatus.amountRaw); const foundBalance = hook.response.balance.balances.find( diff --git a/packages/taler-wallet-webextension/src/cta/Payment/views.tsx b/packages/taler-wallet-webextension/src/cta/Payment/views.tsx index 6b502a87f..0f6cb5c28 100644 --- a/packages/taler-wallet-webextension/src/cta/Payment/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/Payment/views.tsx @@ -65,21 +65,6 @@ 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(); @@ -417,9 +402,6 @@ export function ButtonsSection({ </Fragment> ); } - if (payStatus.status === PreparePayResultType.Lost) { - return <Fragment />; - } assertUnreachable(payStatus); } |