aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src')
-rw-r--r--packages/taler-wallet-webextension/src/NavigationBar.tsx1
-rw-r--r--packages/taler-wallet-webextension/src/components/ExchangeToS.tsx5
-rw-r--r--packages/taler-wallet-webextension/src/cta/Withdraw.tsx12
-rw-r--r--packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx4
-rw-r--r--packages/taler-wallet-webextension/src/popupEntryPoint.tsx18
5 files changed, 26 insertions, 14 deletions
diff --git a/packages/taler-wallet-webextension/src/NavigationBar.tsx b/packages/taler-wallet-webextension/src/NavigationBar.tsx
index 7039808d4..9edd8ca67 100644
--- a/packages/taler-wallet-webextension/src/NavigationBar.tsx
+++ b/packages/taler-wallet-webextension/src/NavigationBar.tsx
@@ -36,6 +36,7 @@ export enum Pages {
manual_withdraw = '/manual-withdraw',
settings = '/settings',
dev = '/dev',
+ cta = '/cta',
backup = '/backup',
history = '/history',
transaction = '/transaction/:tid',
diff --git a/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx b/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx
index b7b0d2fd9..cfa20280f 100644
--- a/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx
+++ b/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx
@@ -21,7 +21,10 @@ import { h } from 'preact';
export function ExchangeXmlTos({ doc }: { doc: Document }) {
const termsNode = doc.querySelector('[ids=terms-of-service]')
if (!termsNode) {
- return <div>not found</div>
+ return <div>
+ <p>The exchange send us an xml but there is no node with 'ids=terms-of-service'. This is the content:</p>
+ <pre>{new XMLSerializer().serializeToString(doc)}</pre>
+ </div>
}
return <Fragment>
{Array.from(termsNode.children).map(renderChild)}
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
index 94f217fc7..5ae1e86ec 100644
--- a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
@@ -214,10 +214,18 @@ export function View({ details, knownExchanges, amount, onWithdraw, onSwitchExch
{i18n.str`Confirm withdrawal`}
</ButtonSuccess>
}
- {terms.status === 'notfound' &&
- <LinkWarning upperCased>
+ {terms.status === 'notfound' && <Fragment>
+ <LinkWarning>
{i18n.str`Exchange doesn't have terms of service`}
</LinkWarning>
+ <ButtonWarning
+ upperCased
+ disabled={!details.exchangeInfo.baseUrl}
+ onClick={onWithdraw}
+ >
+ {i18n.str`Withdraw anyway`}
+ </ButtonWarning>
+ </Fragment>
}
</section>
</WalletAction>
diff --git a/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx b/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx
index 4e3c71682..ef0ec341c 100644
--- a/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx
+++ b/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx
@@ -3,7 +3,7 @@ import { ButtonPrimary, ButtonSuccess, PopupBox } from "../components/styled/ind
export interface Props {
url: string;
- onDismiss: (s: boolean) => void;
+ onDismiss: () => void;
}
export function TalerActionFound({ url, onDismiss }: Props) {
@@ -49,7 +49,7 @@ export function TalerActionFound({ url, onDismiss }: Props) {
</section>
<footer>
<div />
- <ButtonPrimary onClick={() => onDismiss(true)}> Dismiss </ButtonPrimary>
+ <ButtonPrimary onClick={() => onDismiss()}> Dismiss </ButtonPrimary>
</footer>
</PopupBox>;
diff --git a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
index 33a462142..070df554c 100644
--- a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
+++ b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
@@ -66,14 +66,9 @@ if (document.readyState === "loading") {
function Application() {
const [talerActionUrl, setDismissed] = useTalerActionURL()
- if (talerActionUrl) {
- return <div>
- <WalletNavBar />
- <div style={{ width: 400, height: 290 }}>
- <TalerActionFound url={talerActionUrl} onDismiss={setDismissed} />
- </div>
- </div>
- }
+ useEffect(() => {
+ if (talerActionUrl) route(Pages.cta)
+ },[talerActionUrl])
return (
<div>
@@ -81,11 +76,16 @@ function Application() {
<WalletNavBar />
<div style={{ width: 400, height: 290 }}>
<Router history={createHashHistory()}>
+ <Route path={Pages.dev} component={DeveloperPage} />
+
<Route path={Pages.balance} component={BalancePage}
goToWalletManualWithdraw={() => goToWalletPage(Pages.manual_withdraw)}
/>
<Route path={Pages.settings} component={SettingsPage} />
- <Route path={Pages.dev} component={DeveloperPage} />
+ <Route path={Pages.cta} component={() => <TalerActionFound url={talerActionUrl!} onDismiss={() => {
+ setDismissed(true)
+ route(Pages.balance)
+ }} />} />
<Route path={Pages.transaction}
component={({ tid }: { tid: string }) => goToWalletPage(Pages.transaction.replace(':tid', tid))}