commit fb2b4ffc64603941706b35f58562bbfdf4314b58
parent 8003d414e0a2013e0491e8d33801a2c7db27c39b
Author: ms <ms@taler.net>
Date: Mon, 20 Dec 2021 18:39:17 +0100
bank: show QR code to withdraw
Diffstat:
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/packages/bank/src/pages/home/index.tsx b/packages/bank/src/pages/home/index.tsx
@@ -3,6 +3,7 @@ import { h, Fragment, ComponentChildren, VNode } from "preact";
import { useState, useEffect, StateUpdater } from "preact/hooks";
import { Buffer } from "buffer";
import { useTranslator } from "../../i18n";
+import { QR } from "../../components/QR";
/**********************************************
* Type definitions for states and API calls. *
@@ -493,7 +494,9 @@ function Account(props: any) {
*/
if (talerWithdrawUri) {
return (<div>
- <p>Give this address to the Taler wallet: {talerWithdrawUri}</p>
+ <p>Scan the following QR code, and then confirm!</p>
+ <div>{QR({text: talerWithdrawUri})}</div>
+ <p>Content: <pre>{talerWithdrawUri}</pre></p>
{props.children}
</div>);
}
@@ -565,7 +568,13 @@ export function BankHome(): VNode {
accountLabel={backendState.username}>
<button onClick={() => {
- pageStateSetter({...pageState, isLoggedIn: false})
+ pageStateSetter((prevState) => {
+ const {
+ talerWithdrawUri,
+ withdrawalOutcome,
+ withdrawalId, ...rest } = prevState;
+ return {...rest, isLoggedIn: false, withdrawalInProgress: false};
+ })
}}>Sign out</button>
{!pageState.withdrawalInProgress && <button onClick={() => {