« get me outta code hell

content, test: linkContribution: only show first four icons - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-06-15 17:28:59 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-06-15 17:28:59 -0300
commit250b0279844f020753eae6ced6e7c34f0b224347 (patch)
treec89c9e177bd42c92c7497a08a855ce82b3739dad /src
parentfc5c3f4e66660018e835ab0f3b664ef0d6abe2ef (diff)
content, test: linkContribution: only show first four icons
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/linkContribution.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/content/dependencies/linkContribution.js b/src/content/dependencies/linkContribution.js
index 210d5b01..c9b514fe 100644
--- a/src/content/dependencies/linkContribution.js
+++ b/src/content/dependencies/linkContribution.js
@@ -16,9 +16,12 @@ export default {
 
     relations.artistLink = relation('linkArtist', artist);
 
-    relations.artistIcons =
-      (artist.urls ?? []).map(url =>
-        relation('linkExternalAsIcon', url));
+    if (!empty(artist.urls)) {
+      relations.artistIcons =
+        artist.urls
+          .slice(0, 4)
+          .map(url => relation('linkExternalAsIcon', url));
+    }
 
     return relations;
   },
@@ -34,7 +37,7 @@ export default {
 
   generate(data, relations, slots, {html, language}) {
     const hasContributionPart = !!(slots.showContribution && data.contribution);
-    const hasExternalPart = !!(slots.showIcons && !empty(relations.artistIcons));
+    const hasExternalPart = !!(slots.showIcons && relations.artistIcons);
 
     const externalLinks = hasExternalPart &&
       html.tag('span',