« get me outta code hell

content: generateGroupSecondaryNav: fix handling no prev/next - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-05-01 07:04:48 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-05-01 07:04:48 -0300
commit788546b9de7ac5972d749a22c8851f90057ef5e3 (patch)
tree6403c713b662eb2f92e671302a800dc54e82430c /src/content/dependencies
parent0caed2b117d94c5d72443266d85ad86635fff964 (diff)
content: generateGroupSecondaryNav: fix handling no prev/next
Diffstat (limited to 'src/content/dependencies')
-rw-r--r--src/content/dependencies/generateGroupSecondaryNav.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/content/dependencies/generateGroupSecondaryNav.js b/src/content/dependencies/generateGroupSecondaryNav.js
index 17eb5083..a4f81313 100644
--- a/src/content/dependencies/generateGroupSecondaryNav.js
+++ b/src/content/dependencies/generateGroupSecondaryNav.js
@@ -69,12 +69,16 @@ export default {
   }),
 
   generate(data, relations, {html, language}) {
-    const {content: previousNextPart} =
-      relations.previousNextLinks.slots({
-        previousLink: relations.previousGroupLink,
-        nextLink: relations.nextGroupLink,
-        id: true,
-      });
+    const previousNextPart =
+      (relations.previousNextLinks
+        ? relations.previousNextLinks
+            .slots({
+              previousLink: relations.previousGroupLink,
+              nextLink: relations.nextGroupLink,
+              id: true,
+            })
+            .content /* TODO: Kludge. */
+        : null);
 
     const {categoryLink} = relations;
 
@@ -83,7 +87,7 @@ export default {
     return relations.secondaryNav.slots({
       class: 'nav-links-groups',
       content:
-        (relations.previousGroupLink || relations.nextGroupLink
+        (previousNextPart
           ? html.tag('span', {class: 'nav-link'},
               relations.colorStyle.slot('context', 'primary-only'),