From 1a4a4e655a525d558da0343a285906039e4ad27a Mon Sep 17 00:00:00 2001 From: SantaHey <33598903+SantaHey@users.noreply.github.com> Date: Mon, 5 Apr 2021 17:23:41 +0200 Subject: [PATCH] Update horizontalGrid with downloadPromises Adapted from https://github.com/SteamGridDB/steamgriddb-manager/pull/117 --- src/js/Search.jsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/js/Search.jsx b/src/js/Search.jsx index 844806c..c9a2179 100644 --- a/src/js/Search.jsx +++ b/src/js/Search.jsx @@ -70,16 +70,14 @@ class Search extends React.Component { items: clonedItems, }); - //Add horizontalGrid BPM image for Non-Steam Games - if (game.appidold && location.state.assetType == 'horizontalGrid') { - Steam.addAsset(location.state.assetType, game.appidold, item.url); - } - const downloadPromises = []; downloadPromises.push(Steam.addAsset(location.state.assetType, game.appid, item.url)); - // Old app id is for Big Picture Mode - downloadPromises.push(Steam.addAsset(location.state.assetType, game.appidOld, item.url)); + + // Add horizontalGrid BPM image for Non-Steam Games + if (game.appidold && location.state.assetType == 'horizontalGrid') { + downloadPromises.push(Steam.addAsset(location.state.assetType, game.appidold, item.url)); + } Promise.all(downloadPromises).then(() => { clonedItems[itemIndex].downloading = false;