gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated (1bfaf997c -> cd6321d30)


From: gnunet
Subject: [taler-wallet-core] branch master updated (1bfaf997c -> cd6321d30)
Date: Fri, 04 Nov 2022 19:39:06 +0100

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

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

    from 1bfaf997c some fixes
     new 8af72c603 remove unused
     new cd6321d30 min 0 for amount

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/taler-wallet-webextension/compile_core.sh       |  2 --
 packages/taler-wallet-webextension/compile_util.sh       |  3 ---
 packages/taler-wallet-webextension/src/mui/TextField.tsx |  1 +
 .../src/wallet/DestinationSelection.tsx                  | 14 +++++++++++++-
 .../src/wallet/ExchangeSelection/views.tsx               | 16 ++++++++--------
 5 files changed, 22 insertions(+), 14 deletions(-)
 delete mode 100755 packages/taler-wallet-webextension/compile_core.sh
 delete mode 100755 packages/taler-wallet-webextension/compile_util.sh

diff --git a/packages/taler-wallet-webextension/compile_core.sh 
b/packages/taler-wallet-webextension/compile_core.sh
deleted file mode 100755
index b93d543f0..000000000
--- a/packages/taler-wallet-webextension/compile_core.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-pnpm run --filter @gnu-taler/taler-wallet-core compile
diff --git a/packages/taler-wallet-webextension/compile_util.sh 
b/packages/taler-wallet-webextension/compile_util.sh
deleted file mode 100755
index df2c4125a..000000000
--- a/packages/taler-wallet-webextension/compile_util.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-pnpm run --filter @gnu-taler/taler-util compile
-
diff --git a/packages/taler-wallet-webextension/src/mui/TextField.tsx 
b/packages/taler-wallet-webextension/src/mui/TextField.tsx
index c59bb28b6..1c1f5cc49 100644
--- a/packages/taler-wallet-webextension/src/mui/TextField.tsx
+++ b/packages/taler-wallet-webextension/src/mui/TextField.tsx
@@ -40,6 +40,7 @@ export interface Props {
   minRows?: number;
   multiline?: boolean;
   onChange?: (s: string) => void;
+  min?: string;
   placeholder?: string;
   required?: boolean;
 
diff --git 
a/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx 
b/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx
index 1e52f11bc..c584f2aae 100644
--- a/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx
@@ -283,6 +283,11 @@ export function DestinationSelectionGetCash({
   const [currency, setCurrency] = useState(parsedInitialAmount?.currency);
 
   const [amount, setAmount] = useState(parsedInitialAmountValue);
+  function positiveSetAmount(e: string):void {
+    const value = Number.parseInt(e, 10);
+    if (value < 0) return
+    setAmount(String(value))
+  }
   const { i18n } = useTranslationContext();
   const previous1: Contact[] = [];
   const previous2: Contact[] = [
@@ -324,6 +329,7 @@ export function DestinationSelectionGetCash({
         <TextField
           label="Amount"
           type="number"
+          min="0"
           variant="filled"
           error={invalid}
           required
@@ -425,6 +431,11 @@ export function DestinationSelectionSendCash({
   const currency = parsedInitialAmount?.currency;
 
   const [amount, setAmount] = useState(parsedInitialAmountValue);
+  function positiveSetAmount(e: string):void {
+    const value = Number.parseInt(e, 10);
+    if (value < 0) return
+    setAmount(String(value))
+  }
   const { i18n } = useTranslationContext();
   const previous1: Contact[] = [];
   const previous2: Contact[] = [
@@ -466,6 +477,7 @@ export function DestinationSelectionSendCash({
         <TextField
           label="Amount"
           type="number"
+          min="0"
           variant="filled"
           required
           error={invalid}
@@ -474,7 +486,7 @@ export function DestinationSelectionSendCash({
           }
           value={amount}
           onChange={(e) => {
-            setAmount(e);
+            positiveSetAmount(e);
           }}
         />
       </div>
diff --git 
a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/views.tsx 
b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/views.tsx
index e89fc8879..d9a33c5c2 100644
--- a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/views.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/views.tsx
@@ -19,6 +19,7 @@ import { styled } from "@linaria/react";
 import { Fragment, h, VNode } from "preact";
 import { useState } from "preact/hooks";
 import { Amount } from "../../components/Amount.js";
+import { ErrorMessage } from "../../components/ErrorMessage.js";
 import { LoadingError } from "../../components/LoadingError.js";
 import { SelectList } from "../../components/SelectList.js";
 import { Input, SvgIcon } from "../../components/styled/index.js";
@@ -156,17 +157,16 @@ export function NoExchangesView({
   const { i18n } = useTranslationContext();
   if (!currency) {
     return (
-      <div>
-        <i18n.Translate>could not find any exchange</i18n.Translate>
-      </div>
+      <ErrorMessage
+        title={<i18n.Translate>Could not find any exchange</i18n.Translate>}
+      />
     );
+
   }
   return (
-    <div>
-      <i18n.Translate>
-        could not find any exchange for the currency {currency}
-      </i18n.Translate>
-    </div>
+    <ErrorMessage
+      title={<i18n.Translate>Could not find any exchange for the currency 
{currency}</i18n.Translate>}
+    />
   );
 }
 

-- 
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]