Merge pull request 'fix: Opening a sigit asks you to sign when you are not the next signer' (#285) from issue-281 into staging
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m36s
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m36s
Reviewed-on: #285 Reviewed-by: enes <enes@noreply.git.nostrdev.com>
This commit is contained in:
commit
1909534079
@ -47,12 +47,12 @@ export const DisplaySigit = ({
|
|||||||
const { extensions, isSame } = extractFileExtensions(Object.keys(fileHashes))
|
const { extensions, isSame } = extractFileExtensions(Object.keys(fileHashes))
|
||||||
|
|
||||||
const currentUserNpub: string = usersPubkey ? hexToNpub(usersPubkey) : ''
|
const currentUserNpub: string = usersPubkey ? hexToNpub(usersPubkey) : ''
|
||||||
const currentUserSigned =
|
const currentUserNextSigner =
|
||||||
signersStatus[currentUserNpub as `npub1${string}`] === SignStatus.Signed
|
signersStatus[currentUserNpub as `npub1${string}`] === SignStatus.Awaiting
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.itemWrapper}>
|
<div className={styles.itemWrapper}>
|
||||||
{signedStatus === SigitStatus.Complete || currentUserSigned ? (
|
{signedStatus === SigitStatus.Complete || !currentUserNextSigner ? (
|
||||||
<Link
|
<Link
|
||||||
to={`${appPublicRoutes.verify}/${sigitCreateId}`}
|
to={`${appPublicRoutes.verify}/${sigitCreateId}`}
|
||||||
className={styles.insetLink}
|
className={styles.insetLink}
|
||||||
|
@ -25,7 +25,7 @@ import {
|
|||||||
NostrController,
|
NostrController,
|
||||||
RelayController
|
RelayController
|
||||||
} from '../../controllers'
|
} from '../../controllers'
|
||||||
import { appPrivateRoutes } from '../../routes'
|
import { appPrivateRoutes, appPublicRoutes } from '../../routes'
|
||||||
import {
|
import {
|
||||||
CreateSignatureEventContent,
|
CreateSignatureEventContent,
|
||||||
KeyboardCode,
|
KeyboardCode,
|
||||||
@ -950,7 +950,14 @@ export const CreatePage = () => {
|
|||||||
toast.error('Failed to publish notifications')
|
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 {
|
} else {
|
||||||
const zip = new JSZip()
|
const zip = new JSZip()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user