Skip to content

Commit

Permalink
Merge pull request #140 from berkes/feature/link-wwwallet-fix
Browse files Browse the repository at this point in the history
feat: Use a link to www wallet that somewhat works.
  • Loading branch information
Iso5786 authored Dec 17, 2024
2 parents 407f499 + 31c7c43 commit 643d429
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/components/students/SsiAgentModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,20 @@
async function updateQRCode() {
console.debug(`Generate QR for offer: ${offer}`);
wwwalletLink.searchParams.set('credential_offer', offer);
linkClass = '';
// extract the actual URL from the offer, wwwallet cannot handle actual credential_offers yet.
// So only if we have this uri, can we show an import link
const offerURI = new URL(offer);
const offerURIParams = offerURI.searchParams;
console.debug(`params: ${offerURIParams}`);
if (offerURIParams.get("credential_offer_uri") !== null) {
wwwalletLink.searchParams.set('credential_offer_uri', offerURIParams.get("credential_offer_uri"));
linkClass = '';
} else {
linkClass = 'disabled';
wwwalletLink = new URL("#");
}
qrCodeDataUrl = await QRCode.toDataURL(offer);
}
Expand Down

0 comments on commit 643d429

Please sign in to comment.