diff options
author | Sebastian <sebasjm@gmail.com> | 2024-04-09 19:55:45 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-04-09 19:55:45 -0300 |
commit | 86e02c6ecdde78ed741d89c5a64f6bfb79a2426e (patch) | |
tree | 27d30041774d6043b079950b23917def1f335e7e /packages/taler-wallet-webextension/src/wallet/Application.tsx | |
parent | 9dec13056fa7af00e6ba16e6e57d527e3aa25185 (diff) | |
download | wallet-core-86e02c6ecdde78ed741d89c5a64f6bfb79a2426e.tar.xz |
fix #8494
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/Application.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/Application.tsx | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Application.tsx b/packages/taler-wallet-webextension/src/wallet/Application.tsx index 1fc1e46f4..5c31701e2 100644 --- a/packages/taler-wallet-webextension/src/wallet/Application.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Application.tsx @@ -23,7 +23,9 @@ import { Amounts, TalerUri, + TalerUriAction, TranslatedString, + parseTalerUri, stringifyTalerUri, } from "@gnu-taler/taler-util"; import { @@ -84,6 +86,7 @@ import { WelcomePage } from "./Welcome.js"; import { WalletActivity } from "../components/WalletActivity.js"; import { EnabledBySettings } from "../components/EnabledBySettings.js"; import { DevExperimentPage } from "../cta/DevExperiment/index.js"; +import { ConfirmAddExchangeView } from "./AddExchange/views.js"; export function Application(): VNode { const { i18n } = useTranslationContext(); @@ -510,7 +513,28 @@ export function Application(): VNode { </CallToActionTemplate> )} /> - + <Route + path={Pages.ctaAddExchange} + component={({ talerUri }: { talerUri: string }) => { + const tUri = parseTalerUri(decodeURIComponent(talerUri)) + const baseUrl = tUri?.type === TalerUriAction.AddExchange ? tUri.exchangeBaseUrl : undefined + if (!baseUrl) { + redirectTo(Pages.balanceHistory({})) + return <div> + invalid url {talerUri} + </div> + } + return <CallToActionTemplate title={i18n.str`Add exchange`}> + <ConfirmAddExchangeView + url={baseUrl} + status="confirm" + error={undefined} + onCancel={() => redirectTo(Pages.balanceHistory({}))} + onConfirm={() => redirectTo(Pages.balanceHistory({}))} + /> + </CallToActionTemplate> + }} + /> {/** * NOT FOUND * all redirects should be at the end |