Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

20 changes: 12 additions & 8 deletions components/QrCodeOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const QrCodeOverlay: React.FC<QrCodeOverlayProps> = props => {
let qrData: string;
try {
const keyData = await RNSecureKeystoreModule.getData(props.meta.id);
if (keyData[1] && keyData.length > 0) {
if (keyData?.length > 1 && keyData?.[1]) {
qrData = keyData[1];
} else {
throw new Error('No key data found');
Expand Down Expand Up @@ -54,10 +54,12 @@ export const QrCodeOverlay: React.FC<QrCodeOverlayProps> = props => {
const credentialSubject =
props.verifiableCredential?.credential?.credentialSubject;
const claim169Qrs = (credentialSubject as any)?.claim169;
const qr =
claim169Qrs && typeof claim169Qrs === 'object'
? claim169Qrs[Object.keys(claim169Qrs)[0]]
: undefined;
const keys =
claim169Qrs && typeof claim169Qrs === 'object'
? Object.keys(claim169Qrs)
: [];
Comment on lines +58 to +60

const qr = keys.length > 0 ? claim169Qrs?.[keys[0]] : undefined;

if (typeof qr === 'string' && qr.trim().length > 0) {
return {isClaim169QrPresent: true, claim169QrData: qr};
Expand All @@ -68,9 +70,11 @@ export const QrCodeOverlay: React.FC<QrCodeOverlayProps> = props => {
let qrRef = useRef(null);

function handleShareQRCodePress() {
qrRef.current.toDataURL(dataURL => {
shareImage(`${base64ImageType}${dataURL}`);
});
if (qrRef.current?.toDataURL) {
qrRef.current.toDataURL(dataURL => {
shareImage(`${base64ImageType}${dataURL}`);
});
}
Comment on lines 72 to +77
}

async function shareImage(base64String: string) {
Expand Down