diff options
| author | Sebastian <sebasjm@gmail.com> | 2022-09-16 16:03:58 -0300 |
|---|---|---|
| committer | Sebastian <sebasjm@gmail.com> | 2022-09-16 16:03:58 -0300 |
| commit | 59d235e8d29159bc8caccf8bee6a2bca8b0b90dc (patch) | |
| tree | 551261c860b1989dc0b1a05ddcfd53d20e561626 /packages/taler-wallet-webextension/src/cta/Refund/state.ts | |
| parent | 6ddb2de84245ae3914c92b2b2eb7399e7f04500e (diff) | |
redirect after success #7357
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", |
