diff --git a/assets/scripts.js b/assets/scripts.js index 71327bb..40d2519 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -158,6 +158,10 @@ async function verifyProofs(opts) { verifications.push(await verifyProof(notation[1], keyData.fingerprint)); } + // One-line sorting function (order verifications by type) + console.log(keyData.notations); + verifications = verifications.sort((a,b) => (a.type > b.type) ? 1 : ((b.type > a.type) ? -1 : 0)); + // Generate feedback feedback += `

`; for (var i = 0; i < verifications.length; i++) { @@ -191,6 +195,10 @@ async function displayProfile(opts) { verifications.push(await verifyProof(notation[1], keyData.fingerprint)); } + // One-line sorting function (order verifications by type) + console.log(keyData.notations); + verifications = verifications.sort((a,b) => (a.type > b.type) ? 1 : ((b.type > a.type) ? -1 : 0)); + // Generate feedback feedback += `

`; feedback += `
`;