« get me outta code hell

content: generateFlashActSidebar: use flash act listTermonology - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-10-24 10:48:10 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-10-24 10:48:59 -0300
commitf64118417ea45178cfa50c181c9c102e5c8ff1b5 (patch)
tree3ce713141d10037d2247feb479ffa56ec23f09bc /src/content
parentf461941ac3d39b307ac32e21f9ff41b47fba638b (diff)
content: generateFlashActSidebar: use flash act listTermonology
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generateFlashActSidebar.js31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/content/dependencies/generateFlashActSidebar.js b/src/content/dependencies/generateFlashActSidebar.js
index ff5dc049..f8ad33db 100644
--- a/src/content/dependencies/generateFlashActSidebar.js
+++ b/src/content/dependencies/generateFlashActSidebar.js
@@ -75,27 +75,9 @@ export default {
     const currentActIndex =
       currentSideActs.indexOf(act);
 
-    const visualNovelActs = [
-      findFlashAct('flash-act:friendsim'),
-      findFlashAct('flash-act:pesterquest'),
-      findFlashAct('flash-act:psycholonials'),
-    ];
-
-    const gameSeriesActs = [
-      findFlashAct('flash-act:hiveswap'),
-    ];
-
-    const listTerminology =
-      (visualNovelActs.includes(act)
-        ? 'volumesInThisGame'
-     : gameSeriesActs.includes(act)
-        ? 'gamesInThisSeries'
-     : act === findFlashAct('flash-act:other-fan-adventures')
-        ? 'flashesInThisSection'
-     : currentSideIndex <= 1
+    const fallbackListTerminology =
+      (currentSideIndex <= 1
         ? 'flashesInThisAct'
-     : currentSideIndex === 3
-        ? 'flashesInThisStory'
         : 'entriesInThisSection');
 
     return {
@@ -109,7 +91,7 @@ export default {
       currentActFlashes,
       currentFlashIndex,
 
-      listTerminology,
+      fallbackListTerminology,
     };
   },
 
@@ -140,7 +122,8 @@ export default {
     currentActIndex: query.currentActIndex,
     currentFlashIndex: query.currentFlashIndex,
 
-    listTerminology: query.listTerminology,
+    customListTerminology: act.listTerminology,
+    fallbackListTerminology: query.fallbackListTerminology,
   }),
 
   generate(data, relations, {getColors, html, language}) {
@@ -154,7 +137,9 @@ export default {
         [
           html.tag('summary',
             html.tag('span', {class: 'group-name'},
-              language.$('flashSidebar.flashList', data.listTerminology))),
+              (data.customListTerminology
+                ? language.sanitize(data.customListTerminology)
+                : language.$('flashSidebar.flashList', data.fallbackListTerminology)))),
 
           html.tag('ul',
             relations.currentActFlashLinks