diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx b/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx index 3516bfbf1..bebf036c9 100644 --- a/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx +++ b/packages/taler-wallet-webextension/src/wallet/AddNewActionView.tsx @@ -1,9 +1,9 @@ import { classifyTalerUri, TalerUriType } from "@gnu-taler/taler-util"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; +import { platform } from "../platform/api"; import { Button, ButtonSuccess, InputWithLabel } from "../components/styled"; import { useTranslationContext } from "../context/translation"; -import { actionForTalerUri } from "../utils/index"; export interface Props { onCancel: () => void; @@ -14,6 +14,10 @@ export function AddNewActionView({ onCancel }: Props): VNode { const uriType = classifyTalerUri(url); const { i18n } = useTranslationContext(); + function redirectToWallet() { + platform.openWalletURIFromPopup(uriType, url); + } + return ( <Fragment> <section> @@ -37,12 +41,7 @@ export function AddNewActionView({ onCancel }: Props): VNode { <i18n.Translate>Cancel</i18n.Translate> </Button> {uriType !== TalerUriType.Unknown && ( - <ButtonSuccess - onClick={() => { - // eslint-disable-next-line no-undef - chrome.tabs.create({ url: actionForTalerUri(uriType, url) }); - }} - > + <ButtonSuccess onClick={redirectToWallet}> {(() => { switch (uriType) { case TalerUriType.TalerNotifyReserve: |