Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

Commit

Permalink
Update horizontalGrid with downloadPromises
Browse files Browse the repository at this point in the history
Adapted from #117
  • Loading branch information
SantaHey authored and kongomongo committed May 1, 2021
1 parent 1371cff commit 1a4a4e6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/js/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1a4a4e6

Please sign in to comment.