gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: take domain from baseurl inst


From: gnunet
Subject: [taler-wallet-core] branch master updated: take domain from baseurl instead of browser
Date: Thu, 16 Nov 2023 17:29:02 +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 c4ff77168 take domain from baseurl instead of browser
c4ff77168 is described below

commit c4ff77168e233235dcdea24108701dbc9f57fd87
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Thu Nov 16 13:28:57 2023 -0300

    take domain from baseurl instead of browser
---
 packages/aml-backoffice-ui/src/hooks/useBackend.ts |  4 ++--
 packages/aml-backoffice-ui/src/pages/Officer.tsx   | 11 ++++-------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/packages/aml-backoffice-ui/src/hooks/useBackend.ts 
b/packages/aml-backoffice-ui/src/hooks/useBackend.ts
index 95277a915..0615c9c99 100644
--- a/packages/aml-backoffice-ui/src/hooks/useBackend.ts
+++ b/packages/aml-backoffice-ui/src/hooks/useBackend.ts
@@ -74,8 +74,8 @@ export function getInitialBackendBaseURL(): string {
     if (!uiSettings.backendBaseURL) {
       console.error(
         "ERROR: backendBaseURL was overridden by a setting file and missing. 
Setting value to 'window.origin'",
-      );
-      result = window.origin
+      );      
+      result = typeof (window as any) !== "undefined" ? window.origin : 
"localhost"
     } else {
       result = uiSettings.backendBaseURL;
     }
diff --git a/packages/aml-backoffice-ui/src/pages/Officer.tsx 
b/packages/aml-backoffice-ui/src/pages/Officer.tsx
index 21c26f3d4..ec8327814 100644
--- a/packages/aml-backoffice-ui/src/pages/Officer.tsx
+++ b/packages/aml-backoffice-ui/src/pages/Officer.tsx
@@ -3,9 +3,7 @@ import { useOfficer } from "../hooks/useOfficer.js";
 import { HandleAccountNotReady } from "./HandleAccountNotReady.js";
 import { useTranslationContext } from "@gnu-taler/web-util/browser";
 import { uiSettings } from "../settings.js";
-
-const DOMAIN =
-  typeof (window as any) !== "undefined" ? window.origin : "exchange.taler.net"
+import { getInitialBackendBaseURL } from "../hooks/useBackend.js";
 
 export function Officer() {
   const officer = useOfficer();
@@ -14,7 +12,8 @@ export function Officer() {
     return <HandleAccountNotReady officer={officer} />;
   }
 
-  const signupEmail = uiSettings.signupEmail ?? `aml-signup@${DOMAIN}`
+  const url = new URL(getInitialBackendBaseURL())
+  const signupEmail = uiSettings.signupEmail ?? `aml-signup@${url.hostname}`
 
   return (
     <div>
@@ -26,9 +25,7 @@ export function Officer() {
       </div>
       <p>
         <a
-          href={`mailto:${signupEmail}?body=${encodeURIComponent(
-            `I want my AML account\n\n\nPubKey: ${officer.account.id}`,
-          )}`}
+          href={`mailto:${signupEmail}?subject=${encodeURIComponent("Request 
AML signup")}&body=${encodeURIComponent(`I want my AML account\n\n\nPubKey: 
${officer.account.id}`)}`}
           target="_blank"
           rel="noreferrer"
           class="m-4 block rounded-md w-fit border-0 px-3 py-2 text-center 
text-sm bg-indigo-700 text-white shadow-sm hover:bg-indigo-700"

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