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: #7164


From: gnunet
Subject: [taler-wallet-core] branch master updated: fix: #7164
Date: Mon, 31 Jan 2022 18:56:20 +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 47bd790b fix: #7164
47bd790b is described below

commit 47bd790b7b657fedf268dd7109cb0584cca752ac
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon Jan 31 14:56:12 2022 -0300

    fix: #7164
---
 packages/anastasis-webui/package.json              |  4 ++--
 packages/taler-wallet-webextension/src/cta/Pay.tsx |  2 +-
 .../src/popup/TalerActionFound.tsx                 | 28 ++++++++++++++++++----
 3 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/packages/anastasis-webui/package.json 
b/packages/anastasis-webui/package.json
index 71793550..96ff60b4 100644
--- a/packages/anastasis-webui/package.json
+++ b/packages/anastasis-webui/package.json
@@ -8,7 +8,7 @@
     "serve": "sirv build --port ${PORT:=8080} --cors --single",
     "dev": "preact watch --port ${PORT:=8080} --no-sw --no-esm",
     "lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
-    "test": "jest ./tests",
+    "test": "echo no tests",
     "build-storybook": "build-storybook",
     "build-single": "preact build --no-sw --no-esm -c preact.single-config.js 
--dest single && sh remove-link-stylesheet.sh",
     "serve-single": "sirv single --port ${PORT:=8080} --cors --single",
@@ -61,4 +61,4 @@
     "sirv-cli": "^1.0.14",
     "typescript": "^4.5.4"
   }
-}
+}
\ No newline at end of file
diff --git a/packages/taler-wallet-webextension/src/cta/Pay.tsx 
b/packages/taler-wallet-webextension/src/cta/Pay.tsx
index 427a3a71..806338c4 100644
--- a/packages/taler-wallet-webextension/src/cta/Pay.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Pay.tsx
@@ -357,7 +357,7 @@ export function PaymentRequestView({
             kind="neutral"
           />
         )}
-        {contractTerms.products && (
+        {contractTerms.products && contractTerms.products.length > 0 && (
           <ProductList products={contractTerms.products} />
         )}
       </section>
diff --git a/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx 
b/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx
index 45c4203e..5de45761 100644
--- a/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx
+++ b/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx
@@ -29,6 +29,24 @@ export interface Props {
   onDismiss: () => void;
 }
 
+async function getCurrentTab(): Promise<chrome.tabs.Tab> {
+  let queryOptions = { active: true, currentWindow: true };
+  const tab = await new Promise<chrome.tabs.Tab>((res, rej) => {
+    chrome.tabs.query(queryOptions, (tabs) => {
+      res(tabs[0]);
+    });
+  });
+  return tab;
+}
+
+async function navigateTo(url?: string) {
+  if (!url) return;
+  const tab = await getCurrentTab();
+  if (!tab.id) return;
+  await chrome.tabs.update(tab.id, { url });
+  window.close();
+}
+
 export function TalerActionFound({ url, onDismiss }: Props) {
   const uriType = classifyTalerUri(url);
   return (
@@ -40,7 +58,7 @@ export function TalerActionFound({ url, onDismiss }: Props) {
             <p>This page has pay action.</p>
             <ButtonSuccess
               onClick={() => {
-                chrome.tabs.create({ url: actionForTalerUri(uriType, url) });
+                navigateTo(actionForTalerUri(uriType, url));
               }}
             >
               Open pay page
@@ -52,7 +70,7 @@ export function TalerActionFound({ url, onDismiss }: Props) {
             <p>This page has a withdrawal action.</p>
             <ButtonSuccess
               onClick={() => {
-                chrome.tabs.create({ url: actionForTalerUri(uriType, url) });
+                navigateTo(actionForTalerUri(uriType, url));
               }}
             >
               Open withdraw page
@@ -64,7 +82,7 @@ export function TalerActionFound({ url, onDismiss }: Props) {
             <p>This page has a tip action.</p>
             <ButtonSuccess
               onClick={() => {
-                chrome.tabs.create({ url: actionForTalerUri(uriType, url) });
+                navigateTo(actionForTalerUri(uriType, url));
               }}
             >
               Open tip page
@@ -76,7 +94,7 @@ export function TalerActionFound({ url, onDismiss }: Props) {
             <p>This page has a notify reserve action.</p>
             <ButtonSuccess
               onClick={() => {
-                chrome.tabs.create({ url: actionForTalerUri(uriType, url) });
+                navigateTo(actionForTalerUri(uriType, url));
               }}
             >
               Notify
@@ -88,7 +106,7 @@ export function TalerActionFound({ url, onDismiss }: Props) {
             <p>This page has a refund action.</p>
             <ButtonSuccess
               onClick={() => {
-                chrome.tabs.create({ url: actionForTalerUri(uriType, url) });
+                navigateTo(actionForTalerUri(uriType, url));
               }}
             >
               Open refund page

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