Skip to content

Commit

Permalink
Merge pull request #473 from wwWallet/reduce-event-dispatching
Browse files Browse the repository at this point in the history
Minor fix on reducing redundant event emitting
  • Loading branch information
kkmanos authored Dec 3, 2024
2 parents 5adafcc + 7fb66b0 commit 6e8ebfe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/services/OpenID4VCIClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,11 @@ export class OpenID4VCIClient implements IOpenID4VCIClient {
audience: this.config.credentialIssuerIdentifier
})
}
const generateProofsResult = cachedProofs ? { proof_jwts: cachedProofs } : await this.generateNonceProofs(inputs);
proofsArray = generateProofsResult.proof_jwts;
if (proofsArray) {
const generateProofsResult = cachedProofs ? { proof_jwts: cachedProofs } : await this.generateNonceProofs(inputs).then((res) => {
dispatchEvent(new CustomEvent("generatedProof"));
}
return res;
});
proofsArray = generateProofsResult.proof_jwts;
}
catch (err) {
console.error(err);
Expand Down

0 comments on commit 6e8ebfe

Please sign in to comment.