« get me outta code hell

content: listRandomPageLinks: general syntax/slot fixes - 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-11-10 17:46:45 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-11-10 17:46:45 -0400
commit6f9d122f9d1ad5bb7e0aad917bbc1ff218e9b4df (patch)
treefa1f0c865e3b2f3dfe2e4cf9a83447779cb3a6cc /src
parent0bc5cfceebed54f357369daec80ee43e2bf7cb76 (diff)
content: listRandomPageLinks: general syntax/slot fixes
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/listRandomPageLinks.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/content/dependencies/listRandomPageLinks.js b/src/content/dependencies/listRandomPageLinks.js
index 375a72d7..0b904019 100644
--- a/src/content/dependencies/listRandomPageLinks.js
+++ b/src/content/dependencies/listRandomPageLinks.js
@@ -10,7 +10,7 @@ export default {
 
   extraDependencies: ['html', 'language', 'wikiData'],
 
-  sprawl: ({wikiInfo}) => ({wikiInfo}),
+  sprawl: ({albumData, wikiInfo}) => ({albumData, wikiInfo}),
 
   query(sprawl, spec) {
     const query = {spec};
@@ -125,10 +125,10 @@ export default {
 
       showSkipToSection: true,
 
-      chunkIDs: [
-        null,
-        ...data.groupDirectories,
-      ],
+      chunkIDs:
+        (data.groupDirectories
+          ? [null, ...data.groupDirectories]
+          : null),
 
       chunkTitles: [
         {stringsKey: 'misc'},
@@ -171,10 +171,12 @@ export default {
                   stringsKey: 'album',
                   album: albumLink,
                 })))
-            : relations.albumLinks.map(albumLink => ({
-                stringsKey: 'album',
-                album: albumLink,
-              }))),
+            : [
+                relations.undividedAlbumLinks.map(albumLink => ({
+                  stringsKey: 'album',
+                  album: albumLink,
+                })),
+              ]),
       ],
 
       chunkRowAttributes: [
@@ -183,7 +185,7 @@ export default {
           (relations.groupAlbumLinks
             ? relations.groupAlbumLinks.map(albumLinks =>
                 albumLinks.map(() => null))
-            : [relations.albumLinks.map(() => null)]),
+            : [relations.undividedAlbumLinks.map(() => null)]),
       ],
     });
   },