« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/homepage.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/page/homepage.js')
-rw-r--r--src/page/homepage.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/page/homepage.js b/src/page/homepage.js
index 2219593e..c15c969a 100644
--- a/src/page/homepage.js
+++ b/src/page/homepage.js
@@ -1,6 +1,11 @@
 // Homepage specification.
 
-import {getNewAdditions, getNewReleases} from '../util/wiki-data.js';
+import {empty} from '../util/sugar.js';
+
+import {
+  getNewAdditions,
+  getNewReleases,
+} from '../util/wiki-data.js';
 
 export function writeTargetless({wikiData}) {
   const {newsData, staticPageData, homepageLayout, wikiInfo} = wikiData;
@@ -29,7 +34,7 @@ export function writeTargetless({wikiData}) {
               : [];
         }
 
-        if (row.sourceAlbums.length) {
+        if (!empty(row.sourceAlbums)) {
           entry.gridEntries.push(...row.sourceAlbums.map(album => ({item: album})));
         }
 
@@ -86,7 +91,7 @@ export function writeTargetless({wikiData}) {
                           lazy: i > 0,
                         })),
 
-                      entry.actionLinks.length &&
+                      !empty(entry.actionLinks) &&
                         html.tag('div', {class: 'grid-actions'},
                           entry.actionLinks.map(action =>
                             transformInline(action)