[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant-backoffice] 02/02: Show IBAN after login.
From: |
gnunet |
Subject: |
[taler-merchant-backoffice] 02/02: Show IBAN after login. |
Date: |
Tue, 15 Feb 2022 19:14:49 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository merchant-backoffice.
commit 93541e11d9d19ff578c89e8ffcf66bfd5ec91562
Author: ms <ms@taler.net>
AuthorDate: Tue Feb 15 19:14:38 2022 +0100
Show IBAN after login.
---
packages/bank/src/pages/home/index.tsx | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/packages/bank/src/pages/home/index.tsx
b/packages/bank/src/pages/home/index.tsx
index 446cf2e..d56e1d2 100644
--- a/packages/bank/src/pages/home/index.tsx
+++ b/packages/bank/src/pages/home/index.tsx
@@ -105,6 +105,18 @@ interface AccountStateType {
* Helpers. *
***********/
+/**
+ * Extract IBAN from a Payto URI.
+ */
+function getIbanFromPayto(url: string): string {
+ const pathSplit = new URL(url).pathname.split("/");
+ var lastIndex = pathSplit.length - 1;
+ // Happens if the path ends with "/".
+ if (pathSplit[lastIndex] === "") lastIndex--;
+ const iban = pathSplit[lastIndex];
+ return iban;
+}
+
/**
* Parse amount.
*/
@@ -932,6 +944,7 @@ function Account(Props: any): VNode {
}
const balance = parseAmount(data.balance.amount)
return (<Fragment>
+ <p>Hello {accountLabel}, {getIbanFromPayto(data.paytoUri)}.</p>
<p>Your balance is {`${balance.value} ${balance.currency}`}.</p>
<div>
<span>{i18n`Last transactions:`}</span> { txsPages }
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.