gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: fix #8572


From: gnunet
Subject: [taler-wallet-core] branch master updated: fix #8572
Date: Tue, 05 Mar 2024 17:59:55 +0100

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new df3c8cdf0 fix #8572
df3c8cdf0 is described below

commit df3c8cdf0644439221fa4a9ea73d4f7a99f93d8e
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Tue Mar 5 13:51:52 2024 -0300

    fix #8572
---
 .../src/pages/business/CreateCashout.tsx           | 45 ++++++++++++++++------
 1 file changed, 33 insertions(+), 12 deletions(-)

diff --git a/packages/demobank-ui/src/pages/business/CreateCashout.tsx 
b/packages/demobank-ui/src/pages/business/CreateCashout.tsx
index 7adacb775..20053b53c 100644
--- a/packages/demobank-ui/src/pages/business/CreateCashout.tsx
+++ b/packages/demobank-ui/src/pages/business/CreateCashout.tsx
@@ -200,11 +200,15 @@ export function CreateCashout({
   useEffect(() => {
     async function doAsync() {
       await handleError(async () => {
-        if (Amounts.isNonZero(inputAmount)) {
+        const higerThanMin = Amounts.cmp(inputAmount, 
conversionInfo.cashout_min_amount) === 1
+        const notZero = Amounts.isNonZero(inputAmount)
+        if (notZero && higerThanMin) {
           const resp = await (form.isDebit
             ? calculateFromDebit(inputAmount, sellFee)
             : calculateFromCredit(inputAmount, sellFee));
           setCalc(resp);
+        } else {
+          setCalc(zeroCalc)
         }
       });
     }
@@ -224,8 +228,8 @@ export function CreateCashout({
         ? i18n.str`Invalid`
         : Amounts.cmp(limit, calc.debit) === -1
           ? i18n.str`Balance is not enough`
-          : Amounts.cmp(calc.credit, sellFee) === -1
-            ? i18n.str`Need to be higher due to fees`
+          : Amounts.cmp(inputAmount, conversionInfo.cashout_min_amount) < 1
+            ? i18n.str`Needs to be higher than 
${Amounts.stringifyValueWithSpec(Amounts.parseOrThrow(conversionInfo.cashout_min_amount),
 regional_currency_specification).normal}`
             : Amounts.isZero(calc.credit)
               ? i18n.str`The total transfer at destination will be zero`
               : undefined,
@@ -330,6 +334,10 @@ export function CreateCashout({
     ? undefined
     : cashoutAccount.targetPath;
 
+  const cashoutLegalName = !cashoutAccount
+    ? undefined
+    : cashoutAccount.params["receiver-name"];
+
   return (
     <div>
       <LocalNotificationBanner notification={notification} />
@@ -374,15 +382,28 @@ export function CreateCashout({
                 />
               </dd>
             </div>
-            {cashoutAccountName ? (
-              <div class="flex items-center justify-between border-t-2 afu 
pt-4">
-                <dt class="flex items-center text-sm text-gray-600">
-                  <span>
-                    <i18n.Translate>To account</i18n.Translate>
-                  </span>
-                </dt>
-                <dd class="text-sm text-gray-900">{cashoutAccountName}</dd>
-              </div>
+            {cashoutAccountName && cashoutLegalName ? (
+              <Fragment>
+                <div class="flex items-center justify-between border-t-2 afu 
pt-4">
+                  <dt class="flex items-center text-sm text-gray-600">
+                    <span>
+                      <i18n.Translate>To account</i18n.Translate>
+                    </span>
+                  </dt>
+                  <dd class="text-sm text-gray-900">{cashoutAccountName}</dd>
+                </div>
+                <div class="flex items-center justify-between border-t-2 afu 
pt-4">
+                  <dt class="flex items-center text-sm text-gray-600">
+                    <span>
+                      <i18n.Translate>Legal name</i18n.Translate>
+                    </span>
+                  </dt>
+                  <dd class="text-sm text-gray-900">{cashoutLegalName}</dd>
+                </div>
+                <p class="mt-2 text-sm text-gray-500">
+                  <i18n.Translate>If this name doesn't match the account 
holders name your transaction may fail.</i18n.Translate>
+                </p>
+              </Fragment>
             ) : (
               <div class="flex items-center justify-between border-t-2 afu 
pt-4">
                 <Attention type="warning" title={i18n.str`No cashout account`}>

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]