From 3a7e5ebf3adf0232768c667f868dfea615fa161c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 19 Oct 2024 20:32:54 -0300 Subject: content: generateAlbumSidebar: fix up messy box passing --- src/content/dependencies/generateAlbumSidebar.js | 33 ++++++++++++------------ 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/content/dependencies') diff --git a/src/content/dependencies/generateAlbumSidebar.js b/src/content/dependencies/generateAlbumSidebar.js index 3dbe3867..3557a178 100644 --- a/src/content/dependencies/generateAlbumSidebar.js +++ b/src/content/dependencies/generateAlbumSidebar.js @@ -61,24 +61,21 @@ export default { data.isAlbumPage ? 'album' : 'track'); } - const groupAndSeriesBoxes = - stitchArrays({ - groupBox: relations.groupBoxes, - seriesBoxes: relations.seriesBoxes, - }).map(({groupBox, seriesBoxes}) => - [groupBox].concat( - seriesBoxes.map(seriesBox => [ - html.tag('div', - {class: 'sidebar-box-joiner'}, - {class: 'collapsible'}), - seriesBox, - ]))) - .flat(); - return relations.sidebar.slots({ boxes: [ data.isAlbumPage && - groupAndSeriesBoxes, + stitchArrays({ + groupBox: relations.groupBoxes, + seriesBoxes: relations.seriesBoxes, + }).map(({groupBox, seriesBoxes}) => [ + groupBox, + seriesBoxes.map(seriesBox => [ + html.tag('div', + {class: 'sidebar-box-joiner'}, + {class: 'collapsible'}), + seriesBox, + ]), + ]), relations.trackListBox, @@ -86,7 +83,11 @@ export default { relations.conjoinedBox.slots({ attributes: {class: 'conjoined-group-sidebar-box'}, boxes: - groupAndSeriesBoxes + stitchArrays({ + groupBox: relations.groupBoxes, + seriesBoxes: relations.seriesBoxes, + }).map(({groupBox, seriesBoxes}) => [groupBox, ...seriesBoxes]) + .flat() .map(box => box.content), /* TODO: Kludge. */ }), ], -- cgit 1.3.0-6-gf8a5