diff options
author | Sebastian <sebasjm@gmail.com> | 2022-12-22 18:42:18 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-12-22 18:42:18 -0300 |
commit | dc002f99a96752d3f0a10efe44a8a4d0503e8529 (patch) | |
tree | 52ae5cc1239a6aafb6e2f18b774d1d4f4d2afa60 /packages/taler-wallet-webextension/src/cta | |
parent | 5c84c3273668fa5aaeb2ac040eb7b13ad439549c (diff) | |
download | wallet-core-dc002f99a96752d3f0a10efe44a8a4d0503e8529.tar.xz |
support for ext+taler:// while taler:// is not yet allowed as scheme
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw/state.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts index 1ecf05eca..d1853442b 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Withdraw/state.ts @@ -90,7 +90,7 @@ export function useComponentStateFromParams({ } export function useComponentStateFromURI({ - talerWithdrawUri, + talerWithdrawUri: maybeTalerUri, cancel, onSuccess, }: PropsFromURI): RecursiveState<State> { @@ -99,7 +99,10 @@ export function useComponentStateFromURI({ * Ask the wallet about the withdraw URI */ const uriInfoHook = useAsyncAsHook(async () => { - if (!talerWithdrawUri) throw Error("ERROR_NO-URI-FOR-WITHDRAWAL"); + if (!maybeTalerUri) throw Error("ERROR_NO-URI-FOR-WITHDRAWAL"); + const talerWithdrawUri = maybeTalerUri.startsWith("ext+") + ? maybeTalerUri.substring(4) + : maybeTalerUri; const uriInfo = await api.wallet.call( WalletApiOperation.GetWithdrawalDetailsForUri, |