Skip to content

Commit 2de51dd

Browse files
committed
fix(proof-requests): normalize mixed request types
Signed-off-by: Emiliano Suñé <2395873+esune@users.noreply.github.com>
1 parent b6acd8d commit 2de51dd

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

frontend/src/admin/components/showcase/modals/CreateConnectionAndProofScreensModal.tsx

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -420,20 +420,25 @@ export function CreateConnectionAndProofScreensModal({
420420
if (!scenario) return
421421

422422
// Build the requestOptions from credentialRequests
423-
const proofRequests = Array.from(credentialRequests.entries()).map(([credentialId, req]) => {
424-
const credential = showcase?.credentials?.find((c) => c.id === credentialId)
425-
return {
426-
name: credential?.name || req.name,
427-
schema_id: credential?.schema_id,
428-
cred_def_id: credential?.cred_def_id,
429-
cred_id: credential?.id,
430-
icon: req.icon,
431-
properties: req.properties,
432-
...(req.predicates && req.predicates.length > 0 && { predicates: req.predicates }),
433-
nonRevoked: req.nonRevoked,
434-
}
435-
})
436-
proofRequests.push(...Array.from(externalCredentials.values()))
423+
const proofRequests: CredentialRequest[] = [
424+
...Array.from(credentialRequests.entries()).map(([credentialId, req]) => {
425+
const credential = showcase?.credentials?.find((c) => c.id === credentialId)
426+
return {
427+
name: credential?.name || req.name,
428+
schema_id: credential?.schema_id,
429+
cred_def_id: credential?.cred_def_id,
430+
cred_id: credential?.id,
431+
icon: req.icon,
432+
properties: req.properties,
433+
...(req.predicates && req.predicates.length > 0 && { predicates: req.predicates }),
434+
nonRevoked: req.nonRevoked,
435+
}
436+
}),
437+
...Array.from(externalCredentials.values()).map((request) => ({
438+
...request,
439+
nonRevoked: request.nonRevoked,
440+
})),
441+
]
437442
const requestOptions = {
438443
name: verifierName,
439444
text: "Review and confirm the information you're sharing",

0 commit comments

Comments
 (0)