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 #7077 file support


From: gnunet
Subject: [taler-wallet-core] branch master updated: fix #7077 file support
Date: Fri, 24 Jun 2022 19:30:36 +0200

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 73551c83 fix #7077 file support
73551c83 is described below

commit 73551c83c45b591464e8588a9f6a94ba3e9238f6
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Fri Jun 24 14:28:45 2022 -0300

    fix #7077 file support
---
 .../src/pages/home/BackupFinishedScreen.tsx        |  2 +-
 .../src/pages/home/ContinentSelectionScreen.tsx    |  4 +-
 .../src/pages/home/RecoveryFinishedScreen.tsx      | 45 ++++++++++++++--------
 .../src/pages/home/SecretEditorScreen.tsx          |  2 +-
 .../pages/home/authMethod/AuthMethodEmailSetup.tsx |  2 +-
 5 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/packages/anastasis-webui/src/pages/home/BackupFinishedScreen.tsx 
b/packages/anastasis-webui/src/pages/home/BackupFinishedScreen.tsx
index f774d389..d69a0af3 100644
--- a/packages/anastasis-webui/src/pages/home/BackupFinishedScreen.tsx
+++ b/packages/anastasis-webui/src/pages/home/BackupFinishedScreen.tsx
@@ -49,7 +49,7 @@ export function BackupFinishedScreen(): VNode {
                   version {sd.policy_version}
                   {sd.policy_expiration.t_s !== "never"
                     ? ` expires at: ${format(
-                        new Date(sd.policy_expiration.t_s),
+                        new Date(sd.policy_expiration.t_s * 1000),
                         "dd-MM-yyyy",
                       )}`
                     : " without expiration date"}
diff --git 
a/packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx 
b/packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx
index 534f9136..fc9c0f09 100644
--- a/packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx
+++ b/packages/anastasis-webui/src/pages/home/ContinentSelectionScreen.tsx
@@ -135,7 +135,7 @@ export function ContinentSelectionScreen(): VNode {
             Choose the country that issued most of your long-term legal
             documents or personal identifiers.
           </p>
-          <div
+          {/* <div
             style={{
               border: "1px solid gray",
               borderRadius: "0.5em",
@@ -149,7 +149,7 @@ export function ContinentSelectionScreen(): VNode {
               country, you will be asked for a simple number and not real,
               personal identifiable information.
             </p>
-          </div>
+          </div> */}
         </div>
       </div>
     </AnastasisClientFrame>
diff --git a/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx 
b/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx
index fae53d8d..c8615da1 100644
--- a/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx
+++ b/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx
@@ -56,9 +56,11 @@ export function RecoveryFinishedScreen(): VNode {
     );
   }
   const secret = bytesToString(decodeCrock(encodedSecret.value));
-  const contentURI = `data:${encodedSecret.mime},${secret}`;
-  // const fileName = encodedSecret['filename']
-  // data:plain/text;base64,asdasd
+  const plainText =
+    encodedSecret.value.length < 1000 && encodedSecret.mime === "text/plain";
+  const contentURI = !plainText
+    ? secret
+    : `data:${encodedSecret.mime},${secret}`;
   return (
     <AnastasisClientFrame title="Recovery Success" hideNav>
       <h2 class="subtitle">Your secret was recovered</h2>
@@ -68,25 +70,36 @@ export function RecoveryFinishedScreen(): VNode {
         </p>
       )}
       <div class="block buttons" disabled={copied}>
-        <button
-          class="button"
-          onClick={() => {
-            navigator.clipboard.writeText(secret);
-            setCopied(true);
-          }}
+        {plainText ? (
+          <button
+            class="button"
+            onClick={() => {
+              navigator.clipboard.writeText(secret);
+              setCopied(true);
+            }}
+          >
+            {!copied ? "Copy" : "Copied"}
+          </button>
+        ) : undefined}
+
+        <a
+          class="button is-info"
+          download={
+            encodedSecret.filename ? encodedSecret.filename : "secret.file"
+          }
+          href={contentURI}
         >
-          {!copied ? "Copy" : "Copied"}
-        </button>
-        <a class="button is-info" download="secret.txt" href={contentURI}>
           <div class="icon is-small ">
             <i class="mdi mdi-download" />
           </div>
-          <span>Save as</span>
+          <span>Download content</span>
         </a>
       </div>
-      <div class="block">
-        <QR text={secret} />
-      </div>
+      {plainText ? (
+        <div class="block">
+          <QR text={secret} />
+        </div>
+      ) : undefined}
     </AnastasisClientFrame>
   );
 }
diff --git a/packages/anastasis-webui/src/pages/home/SecretEditorScreen.tsx 
b/packages/anastasis-webui/src/pages/home/SecretEditorScreen.tsx
index 329a96d7..93a27837 100644
--- a/packages/anastasis-webui/src/pages/home/SecretEditorScreen.tsx
+++ b/packages/anastasis-webui/src/pages/home/SecretEditorScreen.tsx
@@ -52,7 +52,7 @@ export function SecretEditorScreen(): VNode {
   const secretNext = async (): Promise<void> => {
     const secret = secretFile
       ? {
-          value: encodeCrock(stringToBytes(secretValue)),
+          value: encodeCrock(stringToBytes(secretFile.content)),
           filename: secretFile.name,
           mime: secretFile.type,
         }
diff --git 
a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.tsx 
b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.tsx
index a11d855a..b3af0f08 100644
--- 
a/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.tsx
+++ 
b/packages/anastasis-webui/src/pages/home/authMethod/AuthMethodEmailSetup.tsx
@@ -21,7 +21,7 @@ import { AnastasisClientFrame } from "../index.js";
 import { AuthMethodSetupProps } from "./index.js";
 
 const EMAIL_PATTERN =
-  
/^(([^<>()[]\\.,;:\s@"]+(\.[^<>()[]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
+  
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
 
 export function AuthMethodEmailSetup({
   cancel,

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