From 456dd2cf58f87a09ce3efb8570727055e6236e4d Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 12 Jun 2024 18:15:50 -0300 Subject: content: gAIPFlashesChunkedList: blank if flashes disabled --- .../generateArtistInfoPageFlashesChunkedList.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/content') diff --git a/src/content/dependencies/generateArtistInfoPageFlashesChunkedList.js b/src/content/dependencies/generateArtistInfoPageFlashesChunkedList.js index a0eba8ff..b347faf5 100644 --- a/src/content/dependencies/generateArtistInfoPageFlashesChunkedList.js +++ b/src/content/dependencies/generateArtistInfoPageFlashesChunkedList.js @@ -8,12 +8,22 @@ export default { 'generateArtistInfoPageFlashesChunk', ], - query(artist) { + extraDependencies: ['wikiData'], + + sprawl: ({wikiInfo}) => ({ + enableFlashesAndGames: + wikiInfo.enableFlashesAndGames, + }), + + query(sprawl, artist) { const query = {}; - const allContributions = [ - ...artist.flashContributorContributions, - ]; + const allContributions = + (sprawl.enableFlashesAndGames + ? [ + ...artist.flashContributorContributions, + ] + : []); sortContributionsChronologically( allContributions, @@ -33,7 +43,7 @@ export default { return query; }, - relations: (relation, query, _artist) => ({ + relations: (relation, query, _sprawl, _artist) => ({ chunkedList: relation('generateArtistInfoPageChunkedList'), -- cgit 1.3.0-6-gf8a5