diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/InvoicePay')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts | 1 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts b/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts index 731064661..7c6f13286 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/index.ts @@ -32,6 +32,7 @@ export interface Props { talerPayPullUri: string; onClose: () => Promise<void>; goToWalletManualWithdraw: (amount?: string) => Promise<void>; + onSuccess: (tx: string) => Promise<void>; } export type State = diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts index e69bb4627..c88e80602 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts +++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts @@ -30,7 +30,7 @@ import * as wxApi from "../../wxApi.js"; import { Props, State } from "./index.js"; export function useComponentState( - { talerPayPullUri, onClose, goToWalletManualWithdraw }: Props, + { talerPayPullUri, onClose, goToWalletManualWithdraw, onSuccess }: Props, api: typeof wxApi, ): State { const hook = useAsyncAsHook(async () => { @@ -149,7 +149,7 @@ export function useComponentState( const resp = await api.acceptPeerPullPayment({ peerPullPaymentIncomingId, }); - await onClose(); + onSuccess(resp.transactionId); } catch (e) { if (e instanceof TalerError) { setOperationError(e.errorDetail); |