From a4310675c10f07b030410774587f6fc25b6b2bb5 Mon Sep 17 00:00:00 2001 From: enes Date: Mon, 20 Jan 2025 21:24:18 +0100 Subject: [PATCH] refactor(offline): update strings, create offline navigate to sign/verify w/o auto download --- src/components/FileList/index.tsx | 4 ++-- src/pages/create/index.tsx | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/FileList/index.tsx b/src/components/FileList/index.tsx index 9a52772..62f3119 100644 --- a/src/components/FileList/index.tsx +++ b/src/components/FileList/index.tsx @@ -69,7 +69,7 @@ const FileList = ({ color={'var(--mui-palette-primary-main)'} icon={faLock} /> -   EXPORT (encrypted) +   ENCRYPTED )} {typeof handleExport === 'function' && ( @@ -83,7 +83,7 @@ const FileList = ({ color={'var(--mui-palette-primary-main)'} icon={faTriangleExclamation} /> -   EXPORT (unencrypted) +   UNENCRYPTED )} diff --git a/src/pages/create/index.tsx b/src/pages/create/index.tsx index 5589f68..d5424a9 100644 --- a/src/pages/create/index.tsx +++ b/src/pages/create/index.tsx @@ -8,7 +8,6 @@ import { Tooltip } from '@mui/material' import type { Identifier, XYCoord } from 'dnd-core' -import saveAs from 'file-saver' import JSZip from 'jszip' import { useCallback, useEffect, useRef, useState } from 'react' import { DndProvider, useDrag, useDrop } from 'react-dnd' @@ -928,7 +927,6 @@ export const CreatePage = () => { }) const isFirstSigner = signers[0].pubkey === usersPubkey - if (isFirstSigner) { navigate(appPrivateRoutes.sign, { state: { meta } }) } else { @@ -1001,15 +999,16 @@ export const CreatePage = () => { return } - saveAs(finalZipFile, `request-${unixNow()}.sigit.zip`) - // If user is the next signer, we can navigate directly to sign page - if (signers[0].pubkey === usersPubkey) { + const isFirstSigner = signers[0].pubkey === usersPubkey + if (isFirstSigner) { navigate(appPrivateRoutes.sign, { state: { arrayBuffer } }) } else { - navigate(appPrivateRoutes.homePage) + navigate(appPublicRoutes.verify, { + state: { uploadedZip: arrayBuffer } + }) } } catch (error) { if (error instanceof Error) {