diff --git a/root/static/scripts/edit/externalLinks.js b/root/static/scripts/edit/externalLinks.js index 5805c0f0622..4fed3966d86 100644 --- a/root/static/scripts/edit/externalLinks.js +++ b/root/static/scripts/edit/externalLinks.js @@ -1429,13 +1429,7 @@ export class ExternalLink extends React.Component { const firstLink = props.relationships[0]; let faviconClass: string | void; - for (const key of Object.keys(FAVICON_CLASSES)) { - if (props.url.indexOf(key) > 0) { - faviconClass = FAVICON_CLASSES[key]; - break; - } - } - if (notEmpty && !faviconClass) { + if (notEmpty) { const isHomepage = props.relationships.some(link => { const linkType = link.type ? linkedEntities.link_type[link.type] @@ -1472,7 +1466,15 @@ export class ExternalLink extends React.Component { if (isReview) { faviconClass = 'review'; } else { - faviconClass = 'no'; + for (const key of Object.keys(FAVICON_CLASSES)) { + if (props.url.indexOf(key) > 0) { + faviconClass = FAVICON_CLASSES[key]; + break; + } + } + if (!faviconClass) { + faviconClass = 'no'; + } } } }