diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/TermsOfServiceSection.tsx | 11 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Withdraw.tsx | 9 |
2 files changed, 12 insertions, 8 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/TermsOfServiceSection.tsx b/packages/taler-wallet-webextension/src/cta/TermsOfServiceSection.tsx index cafc43c6f..2073ef775 100644 --- a/packages/taler-wallet-webextension/src/cta/TermsOfServiceSection.tsx +++ b/packages/taler-wallet-webextension/src/cta/TermsOfServiceSection.tsx @@ -27,9 +27,10 @@ export function TermsOfServiceSection({ onReview, }: Props): VNode { const { i18n } = useTranslationContext(); + const ableToReviewTermsOfService = onReview !== undefined; if (!reviewing) { if (!reviewed) { - if (!onReview) { + if (!ableToReviewTermsOfService) { return ( <Fragment> {terms.status === "notfound" && ( @@ -78,7 +79,7 @@ export function TermsOfServiceSection({ } return ( <Fragment> - {onReview && ( + {ableToReviewTermsOfService && ( <section> <LinkSuccess upperCased onClick={() => onReview(true)}> <i18n.Translate>Show terms of service</i18n.Translate> @@ -96,7 +97,7 @@ export function TermsOfServiceSection({ } onToggle={() => { onAccept(!reviewed); - if (onReview) onReview(false); + if (ableToReviewTermsOfService) onReview(false); }} /> </section> @@ -136,7 +137,7 @@ export function TermsOfServiceSection({ )} </section> )} - {reviewed && onReview && ( + {reviewed && ableToReviewTermsOfService && ( <section> <LinkSuccess upperCased onClick={() => onReview(false)}> <i18n.Translate>Hide terms of service</i18n.Translate> @@ -155,7 +156,7 @@ export function TermsOfServiceSection({ } onToggle={() => { onAccept(!reviewed); - if (onReview) onReview(false); + if (ableToReviewTermsOfService) onReview(false); }} /> </section> diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx index 8535c67eb..f19da3960 100644 --- a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx +++ b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx @@ -293,11 +293,14 @@ export function WithdrawPageWithParsedURI({ const details = detailsHook.response; - const onAccept = async (): Promise<void> => { + const onAccept = async (accepted: boolean): Promise<void> => { if (!exchange) return; try { - await wxApi.setExchangeTosAccepted(exchange, details.tos.version); - setReviewed(true); + await wxApi.setExchangeTosAccepted( + exchange, + accepted ? details.tos.version : undefined, + ); + setReviewed(accepted); } catch (e) { if (e instanceof Error) { //FIXME: uncomment this and display error |