« get me outta code hell

content: generateAlbumSidebarTrackSection: avoid undefined open - 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-12-30 14:07:10 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-12-30 16:26:36 -0400
commit649ed77f4df1cc0fff4354ce0f91e961cfab21d1 (patch)
tree5194ef863e843a396cb7c7a950b8f8b7feaee4ee /src/content
parentbbb470ee09a2803ffe3c8465c6dad9e50080fe19 (diff)
content: generateAlbumSidebarTrackSection: avoid undefined open
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/generateAlbumSidebarTrackSection.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/content/dependencies/generateAlbumSidebarTrackSection.js b/src/content/dependencies/generateAlbumSidebarTrackSection.js
index 589bd900..4f470698 100644
--- a/src/content/dependencies/generateAlbumSidebarTrackSection.js
+++ b/src/content/dependencies/generateAlbumSidebarTrackSection.js
@@ -96,20 +96,21 @@ export default {
       data.includesCurrentTrack &&
         {class: 'current'},
 
-      {open:
-        // Allow forcing open via a template slot.
-        // This isn't exactly janky, but the rest of this function
-        // kind of is when you contextualize it in a template...
-        slots.open ||
-
-        // Leave sidebar track sections collapsed on album info page,
-        // since there's already a view of the full track listing
-        // in the main content area.
-        data.isTrackPage &&
-
-        // Only expand the track section which includes the track
-        // currently being viewed by default.
-        data.includesCurrentTrack},
+      // Allow forcing open via a template slot.
+      // This isn't exactly janky, but the rest of this function
+      // kind of is when you contextualize it in a template...
+      slots.open &&
+        {open: true},
+
+      // Leave sidebar track sections collapsed on album info page,
+      // since there's already a view of the full track listing
+      // in the main content area.
+      data.isTrackPage &&
+
+      // Only expand the track section which includes the track
+      // currently being viewed by default.
+      data.includesCurrentTrack &&
+        {open: true},
 
       [
         html.tag('summary', {style},