From 698ecb2ab38481545cee9cd41d4f747f0115c18b Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Mon, 14 Dec 2020 09:40:09 +0100 Subject: [PATCH] Show message when userIds have identical claims --- static/scripts.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/static/scripts.js b/static/scripts.js index 51b0349..c2c7123 100644 --- a/static/scripts.js +++ b/static/scripts.js @@ -357,6 +357,8 @@ async function displayProfile(opts) { return; } + let primaryClaims + feedback = ""; if (userMail) { verifications.forEach((userId, i) => { @@ -380,6 +382,8 @@ async function displayProfile(opts) { userId = userId.sort((a,b) => (a.serviceproviderData.serviceprovider.name > b.serviceproviderData.serviceprovider.name) ? 1 : ((b.serviceproviderData.serviceprovider.name > a.serviceproviderData.serviceprovider.name) ? -1 : 0)); + primaryClaims = userId + userId.forEach((claim, i) => { const claimData = claim.serviceproviderData; if (!claimData.serviceprovider.name) { @@ -423,6 +427,14 @@ async function displayProfile(opts) { userId = userId.sort((a,b) => (a.serviceproviderData.serviceprovider.name > b.serviceproviderData.serviceprovider.name) ? 1 : ((b.serviceproviderData.serviceprovider.name > a.serviceproviderData.serviceprovider.name) ? -1 : 0)); + if (primaryClaims && primaryClaims.toString() == userId.toString()) { + feedback += `
`; + feedback += `
`; + feedback += `
Identical to primary
`; + feedback += `
`; + return; + } + userId.forEach((claim, i) => { const claimData = claim.serviceproviderData; if (!claimData.serviceprovider.name) {