diff options
-rw-r--r-- | packages/demobank-ui/src/pages/PaymentOptions.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/demobank-ui/src/pages/PaymentOptions.tsx b/packages/demobank-ui/src/pages/PaymentOptions.tsx index b13f7539f..095958afb 100644 --- a/packages/demobank-ui/src/pages/PaymentOptions.tsx +++ b/packages/demobank-ui/src/pages/PaymentOptions.tsx @@ -23,6 +23,7 @@ import { EmptyObject, RouteDefinition } from "../route.js"; import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { useWithdrawalDetails } from "../hooks/access.js"; import { useEffect } from "preact/hooks"; +import { useBackendState } from "../hooks/backend.js"; function ShowOperationPendingTag({ woid, @@ -32,13 +33,16 @@ function ShowOperationPendingTag({ onOperationAlreadyCompleted?: () => void; }): VNode { const { i18n } = useTranslationContext(); + const { state: credentials } = useBackendState(); const result = useWithdrawalDetails(woid); const loading = !result const error = !loading && (result instanceof TalerError || result.type === "fail"); const pending = !loading && !error && - (result.body.status === "pending" || result.body.status === "selected"); + (result.body.status === "pending" || result.body.status === "selected") + && credentials.status === "loggedIn" + && credentials.username === result.body.username; useEffect(() => { if (!loading && !pending && onOperationAlreadyCompleted) { onOperationAlreadyCompleted(); |