From e4688c89afe700a8addf5173b80af953fa89f421 Mon Sep 17 00:00:00 2001 From: Hjort Date: Thu, 24 Aug 2023 09:38:17 +0200 Subject: [PATCH] Fix proof blank screen, when wallet contains vc that is not on chain --- packages/browser-wallet/CHANGELOG.md | 6 ++++++ .../src/popup/pages/Web3ProofRequest/Web3ProofRequest.tsx | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/browser-wallet/CHANGELOG.md b/packages/browser-wallet/CHANGELOG.md index b0f5000f..0f72e4fb 100644 --- a/packages/browser-wallet/CHANGELOG.md +++ b/packages/browser-wallet/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Fixed + +- Wallet crashing when showing a proof request, while having a verifiable credential that is not yet on chain (or we otherwise fail to retrieve the status) + ## 1.1.1 ### Fixed diff --git a/packages/browser-wallet/src/popup/pages/Web3ProofRequest/Web3ProofRequest.tsx b/packages/browser-wallet/src/popup/pages/Web3ProofRequest/Web3ProofRequest.tsx index c04788cd..fcf3a6f8 100644 --- a/packages/browser-wallet/src/popup/pages/Web3ProofRequest/Web3ProofRequest.tsx +++ b/packages/browser-wallet/src/popup/pages/Web3ProofRequest/Web3ProofRequest.tsx @@ -66,7 +66,9 @@ async function getAllCredentialStatuses( ): Promise> { const statuses = await Promise.all( credentials.map((credential) => - getVerifiableCredentialStatus(client, credential.id).then((status) => [credential.id, status]) + getVerifiableCredentialStatus(client, credential.id) + .then((status) => [credential.id, status]) + .catch(() => [credential.id, VerifiableCredentialStatus.Pending]) ) ); return Object.fromEntries(statuses);