From ae3d461661f41f7243828015d26c2431ebb91fda Mon Sep 17 00:00:00 2001 From: Stixx Date: Mon, 23 Dec 2024 13:57:25 +0100 Subject: [PATCH 1/2] fix: Opening a sigit asks you to sign when you are not the next signer --- src/components/DisplaySigit/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/DisplaySigit/index.tsx b/src/components/DisplaySigit/index.tsx index 93cbc77..5147b45 100644 --- a/src/components/DisplaySigit/index.tsx +++ b/src/components/DisplaySigit/index.tsx @@ -47,12 +47,12 @@ export const DisplaySigit = ({ const { extensions, isSame } = extractFileExtensions(Object.keys(fileHashes)) const currentUserNpub: string = usersPubkey ? hexToNpub(usersPubkey) : '' - const currentUserSigned = - signersStatus[currentUserNpub as `npub1${string}`] === SignStatus.Signed + const currentUserNextSigner = + signersStatus[currentUserNpub as `npub1${string}`] === SignStatus.Awaiting return (
- {signedStatus === SigitStatus.Complete || currentUserSigned ? ( + {signedStatus === SigitStatus.Complete || !currentUserNextSigner ? ( Date: Tue, 24 Dec 2024 10:58:29 +0100 Subject: [PATCH 2/2] fix: If creator is not the first signer we should not redirect to /sign page --- src/pages/create/index.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pages/create/index.tsx b/src/pages/create/index.tsx index 82f4d0c..6e46fe8 100644 --- a/src/pages/create/index.tsx +++ b/src/pages/create/index.tsx @@ -25,7 +25,7 @@ import { NostrController, RelayController } from '../../controllers' -import { appPrivateRoutes } from '../../routes' +import { appPrivateRoutes, appPublicRoutes } from '../../routes' import { CreateSignatureEventContent, KeyboardCode, @@ -925,7 +925,14 @@ export const CreatePage = () => { toast.error('Failed to publish notifications') }) - navigate(appPrivateRoutes.sign, { state: { meta } }) + const isFirstSigner = signers[0].pubkey === usersPubkey + + if (isFirstSigner) { + navigate(appPrivateRoutes.sign, { state: { meta } }) + } else { + const createSignatureJson = JSON.parse(createSignature) + navigate(`${appPublicRoutes.verify}/${createSignatureJson.id}`) + } } else { const zip = new JSZip()