« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateFlashActNavAccent.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateFlashActNavAccent.js')
-rw-r--r--src/content/dependencies/generateFlashActNavAccent.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/content/dependencies/generateFlashActNavAccent.js b/src/content/dependencies/generateFlashActNavAccent.js
index 98504385..424948f9 100644
--- a/src/content/dependencies/generateFlashActNavAccent.js
+++ b/src/content/dependencies/generateFlashActNavAccent.js
@@ -1,4 +1,4 @@
-import {empty} from '#sugar';
+import {atOffset, empty} from '#sugar';
 
 export default {
   contentDependencies: [
@@ -17,17 +17,14 @@ export default {
     const flashActs =
       sprawl.flashActData;
 
-    const index = flashActs.indexOf(flashAct);
+    const index =
+      flashActs.indexOf(flashAct);
 
     const previousFlashAct =
-      (index > 0
-        ? flashActs[index - 1]
-        : null);
+      atOffset(flashActs, index, -1);
 
     const nextFlashAct =
-      (index < flashActs.length - 1
-        ? flashActs[index + 1]
-        : null);
+      atOffset(flashActs, index, +1);
 
     return {previousFlashAct, nextFlashAct};
   },