« get me outta code hell

content: generateArtistGroupContributionsInfo: fix N/A sort - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-05-31 12:06:12 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-31 12:06:12 -0300
commite47626f08436816cd855148aa8f663888923a919 (patch)
tree0db61375f8b42d22d900af7cd887575660e6d8bb
parentb00f5793edaaaad8b87e57f6eaacd7b230825ee0 (diff)
content: generateArtistGroupContributionsInfo: fix N/A sort
-rw-r--r--src/content/dependencies/generateArtistGroupContributionsInfo.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/content/dependencies/generateArtistGroupContributionsInfo.js b/src/content/dependencies/generateArtistGroupContributionsInfo.js
index 1725d4b9..ef81739d 100644
--- a/src/content/dependencies/generateArtistGroupContributionsInfo.js
+++ b/src/content/dependencies/generateArtistGroupContributionsInfo.js
@@ -161,9 +161,15 @@ export default {
       slots.visible && 'visible',
     ];
 
+    // TODO: It feels pretty awkward that this component is the only one that
+    // has enough knowledge to decide if the sort button is even applicable...
+    const switchingSortPossible =
+      !empty(relations.groupLinksSortedByCount) &&
+      !empty(relations.groupLinksSortedByDuration);
+
     return html.tags([
       html.tag('dt', {class: topLevelClasses},
-        (slots.showSortButton
+        (switchingSortPossible && slots.showSortButton
           ? language.$('artistPage.groupContributions.title.withSortButton', {
               title: slots.title,
               sort: