diff --git a/src/components/EmbedPageRenderer.js b/src/components/EmbedPageRenderer.js index 3110d57c..46fddd95 100644 --- a/src/components/EmbedPageRenderer.js +++ b/src/components/EmbedPageRenderer.js @@ -1,3 +1,4 @@ +const _ = require('lodash'); // Render only for an export const { saneName } = require('../utils/saneName'); const { h } = require('../utils/format'); @@ -38,12 +39,13 @@ module.exports.render = function({items, exportUrl}) {
${ groupedItems.map( (groupedItem) => { - const cardElements = groupedItem.items.map( (item) => cardFn({item})); + const uniqItems = _.uniqBy(groupedItem.items, (x) => x.name + x.logo); + const cardElements = uniqItems.map( (item) => cardFn({item})); const header = items.length > 0 ? `
${h(groupedItem.header)} -  (${groupedItem.items.length}) +  (${uniqItems.length})
` : ''; return [ header, `
${cardElements.join('')}
`].join('');