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/Tip/state.ts | |
| parent | 6ddb2de84245ae3914c92b2b2eb7399e7f04500e (diff) | |
redirect after success #7357
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Tip/state.ts')
| -rw-r--r-- | packages/taler-wallet-webextension/src/cta/Tip/state.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Tip/state.ts b/packages/taler-wallet-webextension/src/cta/Tip/state.ts index 333337e78..a3adafe53 100644 --- a/packages/taler-wallet-webextension/src/cta/Tip/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Tip/state.ts @@ -21,7 +21,7 @@ import * as wxApi from "../../wxApi.js"; import { Props, State } from "./index.js"; export function useComponentState( - { talerTipUri, onCancel }: Props, + { talerTipUri, onCancel, onSuccess }: Props, api: typeof wxApi, ): State { const [tipIgnored, setTipIgnored] = useState(false); @@ -48,8 +48,11 @@ export function useComponentState( const { tip } = tipInfo.response; const doAccept = async (): Promise<void> => { - await api.acceptTip({ walletTipId: tip.walletTipId }); + const res = await api.acceptTip({ walletTipId: tip.walletTipId }); + + //FIX: this may not be seen since we are moving to the success also tipInfo.retry(); + onSuccess(res.transactionId) }; const baseInfo = { |
