diff options
Diffstat (limited to 'packages/anastasis-webui/src/pages')
-rw-r--r-- | packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx b/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx index 62ac410a2..f528bc207 100644 --- a/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx +++ b/packages/anastasis-webui/src/pages/home/RecoveryFinishedScreen.tsx @@ -58,9 +58,14 @@ export function RecoveryFinishedScreen(): VNode { const secret = bytesToString(decodeCrock(encodedSecret.value)); const plainText = encodedSecret.value.length < 1000 && encodedSecret.mime === "text/plain"; - const contentURI = !plainText - ? secret - : `data:${encodedSecret.mime},${secret}`; + + let [uri, setUri] = useState(`data:${encodedSecret.mime},${secret}`); + fetch(`data:${encodedSecret.mime},${secret}`) // TODO: look into using new Blob + .then((v) => v.blob()) + .then((blob) => URL.createObjectURL(blob)) + .then((newUri) => { + setUri(newUri); + }); return ( <AnastasisClientFrame title="Recovery Success" hideNav> <h2 class="subtitle">Your secret was recovered</h2> @@ -87,7 +92,7 @@ export function RecoveryFinishedScreen(): VNode { download={ encodedSecret.filename ? encodedSecret.filename : "secret.file" } - href={contentURI} + href={uri} > <div class="icon is-small "> <i class="mdi mdi-download" /> |