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,10 +215,12 @@ async function displayProfile(opts) {
feedback += `<div class="profileDataItem__value">general information</div>`;
feedback += `</div>`;
for (var i = 0; i < keyData.publicKey.users.length; i++) {
feedback += `<div class="profileDataItem">`;
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>`;
if (keyData.publicKey.users[i].userId && 'email' in keyData.publicKey.users[i].userId) {
feedback += `<div class="profileDataItem">`;
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>`;
}
}
feedback += `<div class="profileDataItem">`;
feedback += `<div class="profileDataItem__label">fingerprint</div>`;