« 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
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
parent0caed2b117d94c5d72443266d85ad86635fff964 (diff)
content: generateGroupSecondaryNav: fix handling no prev/next staging
Diffstat (limited to 'src')
-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 17eb508..a4f8131 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'),