« get me outta code hell

content: generateFlashNavAccent: match sidebar sort directly - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateFlashNavAccent.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-08-10 12:17:59 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-08-10 12:17:59 -0300
commita1ee94f681c858951bbc4fffe94ebd1d4449b6d7 (patch)
tree8a417269cae17aca311718da77f4249be1966a1f /src/content/dependencies/generateFlashNavAccent.js
parent178397c9af193b2cebd3f8552b1e725a7b432b48 (diff)
content: generateFlashNavAccent: match sidebar sort directly
Diffstat (limited to 'src/content/dependencies/generateFlashNavAccent.js')
-rw-r--r--src/content/dependencies/generateFlashNavAccent.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/content/dependencies/generateFlashNavAccent.js b/src/content/dependencies/generateFlashNavAccent.js
index 1e2d1852..c56e614f 100644
--- a/src/content/dependencies/generateFlashNavAccent.js
+++ b/src/content/dependencies/generateFlashNavAccent.js
@@ -1,5 +1,4 @@
 import {empty} from '../../util/sugar.js';
-import {sortFlashesChronologically} from '../../util/wiki-data.js';
 
 export default {
   contentDependencies: [
@@ -9,13 +8,16 @@ export default {
 
   extraDependencies: ['html', 'language', 'wikiData'],
 
-  sprawl({flashData}) {
-    return {flashData};
+  sprawl({flashActData}) {
+    return {flashActData};
   },
 
   query(sprawl, flash) {
+    // Don't sort chronologically here. The previous/next buttons should match
+    // the order in the sidebar, by act rather than date.
     const flashes =
-      sortFlashesChronologically(sprawl.flashData.slice());
+      sprawl.flashActData
+        .flatMap(act => act.flashes);
 
     const index = flashes.indexOf(flash);