Handle user identities without userId or email

This commit is contained in:
Yarmo Mackenbach 2020-07-02 09:11:38 +02:00
parent 2f37a69ba8
commit f47001a41e

View file

@ -215,11 +215,13 @@ async function displayProfile(opts) {
feedback += `<div class="profileDataItem__value">general information</div>`; feedback += `<div class="profileDataItem__value">general information</div>`;
feedback += `</div>`; feedback += `</div>`;
for (var i = 0; i < keyData.publicKey.users.length; i++) { for (var i = 0; i < keyData.publicKey.users.length; i++) {
if (keyData.publicKey.users[i].userId && 'email' in keyData.publicKey.users[i].userId) {
feedback += `<div class="profileDataItem">`; feedback += `<div class="profileDataItem">`;
feedback += `<div class="profileDataItem__label">email</div>`; feedback += `<div class="profileDataItem__label">email</div>`;
feedback += `<div class="profileDataItem__value"><a href="mailto:${keyData.publicKey.users[i].userId.email}">${keyData.publicKey.users[i].userId.email}</a></div>`; feedback += `<div class="profileDataItem__value"><a href="mailto:${keyData.publicKey.users[i].userId.email}">${keyData.publicKey.users[i].userId.email}</a></div>`;
feedback += `</div>`; feedback += `</div>`;
} }
}
feedback += `<div class="profileDataItem">`; feedback += `<div class="profileDataItem">`;
feedback += `<div class="profileDataItem__label">fingerprint</div>`; feedback += `<div class="profileDataItem__label">fingerprint</div>`;
feedback += `<div class="profileDataItem__value"><a href="https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x${keyData.fingerprint}">${keyData.fingerprint}</a></div>`; feedback += `<div class="profileDataItem__value"><a href="https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x${keyData.fingerprint}">${keyData.fingerprint}</a></div>`;