gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-wallet-webex] branch master updated (f1bef047 -> 652


From: gnunet
Subject: [GNUnet-SVN] [taler-wallet-webex] branch master updated (f1bef047 -> 65228afb)
Date: Tue, 20 Feb 2018 09:34:05 +0100

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

dold pushed a change to branch master
in repository wallet-webex.

    from f1bef047 prevent embedding wallet pages in other web pages
     new 774a79d9 min version for Firefox
     new 65228afb render both string and JSON amounts correctly to HTML

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:
 manifest.json            |  2 +-
 src/webex/renderHtml.tsx | 17 +++++++++++++----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/manifest.json b/manifest.json
index 3df7aa68..9968c51b 100644
--- a/manifest.json
+++ b/manifest.json
@@ -13,7 +13,7 @@
   "applications": {
     "gecko": {
       "id": "address@hidden",
-      "strict_min_version": "50.0a1"
+      "strict_min_version": "58.0"
     }
   },
 
diff --git a/src/webex/renderHtml.tsx b/src/webex/renderHtml.tsx
index 2e21932b..e4686ade 100644
--- a/src/webex/renderHtml.tsx
+++ b/src/webex/renderHtml.tsx
@@ -48,12 +48,21 @@ import * as React from "react";
  * Render amount as HTML, which non-breaking space between
  * decimal value and currency.
  */
-export function renderAmount(amount: AmountJson) {
-  const x = amount.value + amount.fraction / Amounts.fractionalBase;
-  return <span>{x}&nbsp;{amount.currency}</span>;
+export function renderAmount(amount: AmountJson | string) {
+  let a;
+  if (typeof amount === "string") {
+    a = Amounts.parse(amount);
+  } else {
+    a = amount;
+  }
+  if (!a) {
+    return <span>(invalid amount)</span>;
+  }
+  const x = a.value + a.fraction / Amounts.fractionalBase;
+  return <span>{x}&nbsp;{a.currency}</span>;
 }
 
-export const AmountDisplay = ({amount}: {amount: AmountJson}) => 
renderAmount(amount);
+export const AmountDisplay = ({amount}: {amount: AmountJson | string}) => 
renderAmount(amount);
 
 
 /**

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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