diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/content/dependencies/generateAlbumSidebar.js | 33 |
1 files changed, 17 insertions, 16 deletions
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. */ }), ], |