diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Refund/state.ts')
| -rw-r--r-- | packages/taler-wallet-webextension/src/cta/Refund/state.ts | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Refund/state.ts b/packages/taler-wallet-webextension/src/cta/Refund/state.ts index 8d36b61ea..16dbbf70d 100644 --- a/packages/taler-wallet-webextension/src/cta/Refund/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Refund/state.ts @@ -21,7 +21,7 @@ import * as wxApi from "../../wxApi.js"; import { Props, State } from "./index.js"; export function useComponentState( - { talerRefundUri, cancel }: Props, + { talerRefundUri, cancel, onSuccess }: Props, api: typeof wxApi, ): State { const [ignored, setIgnored] = useState(false); @@ -51,8 +51,9 @@ export function useComponentState( const { refund, uri } = info.response; const doAccept = async (): Promise<void> => { - await api.applyRefund(uri); - info.retry(); + const res = await api.applyRefund(uri); + + onSuccess(res.transactionId); }; const doIgnore = async (): Promise<void> => { @@ -75,13 +76,6 @@ export function useComponentState( }; } - if (Amounts.isZero(baseInfo.awaitingAmount)) { - return { - status: "completed", - ...baseInfo, - }; - } - if (refund.pending) { return { status: "in-progress", |
