fix #7077 file support
This commit is contained in:
parent
2f8fd783b6
commit
73551c83c4
@ -49,7 +49,7 @@ export function BackupFinishedScreen(): VNode {
|
|||||||
version {sd.policy_version}
|
version {sd.policy_version}
|
||||||
{sd.policy_expiration.t_s !== "never"
|
{sd.policy_expiration.t_s !== "never"
|
||||||
? ` expires at: ${format(
|
? ` expires at: ${format(
|
||||||
new Date(sd.policy_expiration.t_s),
|
new Date(sd.policy_expiration.t_s * 1000),
|
||||||
"dd-MM-yyyy",
|
"dd-MM-yyyy",
|
||||||
)}`
|
)}`
|
||||||
: " without expiration date"}
|
: " without expiration date"}
|
||||||
|
@ -135,7 +135,7 @@ export function ContinentSelectionScreen(): VNode {
|
|||||||
Choose the country that issued most of your long-term legal
|
Choose the country that issued most of your long-term legal
|
||||||
documents or personal identifiers.
|
documents or personal identifiers.
|
||||||
</p>
|
</p>
|
||||||
<div
|
{/* <div
|
||||||
style={{
|
style={{
|
||||||
border: "1px solid gray",
|
border: "1px solid gray",
|
||||||
borderRadius: "0.5em",
|
borderRadius: "0.5em",
|
||||||
@ -149,7 +149,7 @@ export function ContinentSelectionScreen(): VNode {
|
|||||||
country, you will be asked for a simple number and not real,
|
country, you will be asked for a simple number and not real,
|
||||||
personal identifiable information.
|
personal identifiable information.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AnastasisClientFrame>
|
</AnastasisClientFrame>
|
||||||
|
@ -56,9 +56,11 @@ export function RecoveryFinishedScreen(): VNode {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
const secret = bytesToString(decodeCrock(encodedSecret.value));
|
const secret = bytesToString(decodeCrock(encodedSecret.value));
|
||||||
const contentURI = `data:${encodedSecret.mime},${secret}`;
|
const plainText =
|
||||||
// const fileName = encodedSecret['filename']
|
encodedSecret.value.length < 1000 && encodedSecret.mime === "text/plain";
|
||||||
// data:plain/text;base64,asdasd
|
const contentURI = !plainText
|
||||||
|
? secret
|
||||||
|
: `data:${encodedSecret.mime},${secret}`;
|
||||||
return (
|
return (
|
||||||
<AnastasisClientFrame title="Recovery Success" hideNav>
|
<AnastasisClientFrame title="Recovery Success" hideNav>
|
||||||
<h2 class="subtitle">Your secret was recovered</h2>
|
<h2 class="subtitle">Your secret was recovered</h2>
|
||||||
@ -68,6 +70,7 @@ export function RecoveryFinishedScreen(): VNode {
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
<div class="block buttons" disabled={copied}>
|
<div class="block buttons" disabled={copied}>
|
||||||
|
{plainText ? (
|
||||||
<button
|
<button
|
||||||
class="button"
|
class="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@ -77,16 +80,26 @@ export function RecoveryFinishedScreen(): VNode {
|
|||||||
>
|
>
|
||||||
{!copied ? "Copy" : "Copied"}
|
{!copied ? "Copy" : "Copied"}
|
||||||
</button>
|
</button>
|
||||||
<a class="button is-info" download="secret.txt" href={contentURI}>
|
) : undefined}
|
||||||
|
|
||||||
|
<a
|
||||||
|
class="button is-info"
|
||||||
|
download={
|
||||||
|
encodedSecret.filename ? encodedSecret.filename : "secret.file"
|
||||||
|
}
|
||||||
|
href={contentURI}
|
||||||
|
>
|
||||||
<div class="icon is-small ">
|
<div class="icon is-small ">
|
||||||
<i class="mdi mdi-download" />
|
<i class="mdi mdi-download" />
|
||||||
</div>
|
</div>
|
||||||
<span>Save as</span>
|
<span>Download content</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
{plainText ? (
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<QR text={secret} />
|
<QR text={secret} />
|
||||||
</div>
|
</div>
|
||||||
|
) : undefined}
|
||||||
</AnastasisClientFrame>
|
</AnastasisClientFrame>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ export function SecretEditorScreen(): VNode {
|
|||||||
const secretNext = async (): Promise<void> => {
|
const secretNext = async (): Promise<void> => {
|
||||||
const secret = secretFile
|
const secret = secretFile
|
||||||
? {
|
? {
|
||||||
value: encodeCrock(stringToBytes(secretValue)),
|
value: encodeCrock(stringToBytes(secretFile.content)),
|
||||||
filename: secretFile.name,
|
filename: secretFile.name,
|
||||||
mime: secretFile.type,
|
mime: secretFile.type,
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ import { AnastasisClientFrame } from "../index.js";
|
|||||||
import { AuthMethodSetupProps } from "./index.js";
|
import { AuthMethodSetupProps } from "./index.js";
|
||||||
|
|
||||||
const EMAIL_PATTERN =
|
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({
|
export function AuthMethodEmailSetup({
|
||||||
cancel,
|
cancel,
|
||||||
|
Loading…
Reference in New Issue
Block a user