aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/pages/QrCodeSection.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-12-01 14:50:13 -0300
committerSebastian <sebasjm@gmail.com>2023-12-01 14:50:13 -0300
commit685f747b6a24ae0d25f2bb458074c955e5acdbc4 (patch)
tree317b3738e532e1d993aca617181c69aa137c21ba /packages/demobank-ui/src/pages/QrCodeSection.tsx
parent6b1bee3fe0e933b3c7421fc6d3d0425a01c41e30 (diff)
downloadwallet-core-685f747b6a24ae0d25f2bb458074c955e5acdbc4.tar.gz
wallet-core-685f747b6a24ae0d25f2bb458074c955e5acdbc4.tar.bz2
wallet-core-685f747b6a24ae0d25f2bb458074c955e5acdbc4.zip
sync demobank with new libeufin API, still missing when the withdrawal operation is not the same user that created the transfer
Diffstat (limited to 'packages/demobank-ui/src/pages/QrCodeSection.tsx')
-rw-r--r--packages/demobank-ui/src/pages/QrCodeSection.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/demobank-ui/src/pages/QrCodeSection.tsx b/packages/demobank-ui/src/pages/QrCodeSection.tsx
index f1394b3f6..60beb012e 100644
--- a/packages/demobank-ui/src/pages/QrCodeSection.tsx
+++ b/packages/demobank-ui/src/pages/QrCodeSection.tsx
@@ -30,6 +30,7 @@ import { useBankCoreApiContext } from "../context/config.js";
import { withRuntimeErrorHandling } from "../utils.js";
import { assertUnreachable } from "./WithdrawalOperationPage.js";
import { LocalNotificationBanner } from "@gnu-taler/web-util/browser";
+import { useBackendState } from "../hooks/backend.js";
export function QrCodeSection({
withdrawUri,
@@ -40,6 +41,9 @@ export function QrCodeSection({
}): VNode {
const { i18n } = useTranslationContext();
const talerWithdrawUri = stringifyWithdrawUri(withdrawUri);
+ const { state: credentials } = useBackendState();
+ const creds = credentials.status !== "loggedIn" ? undefined : credentials
+
useEffect(() => {
//Taler Wallet WebExtension is listening to headers response and tab updates.
//In the SPA there is no header response with the Taler URI so
@@ -58,7 +62,8 @@ export function QrCodeSection({
async function doAbort() {
await handleError(async () => {
- const resp = await api.abortWithdrawalById(withdrawUri.withdrawalOperationId);
+ if (!creds) return;
+ const resp = await api.abortWithdrawalById(creds, withdrawUri.withdrawalOperationId);
if (resp.type === "ok") {
onAborted();
} else {