Skip to content

Commit

Permalink
fix: fetch remote images
Browse files Browse the repository at this point in the history
  • Loading branch information
L0wry committed Jul 11, 2018
1 parent b85c0bc commit a189c27
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/comparisonActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,21 @@ const clearDirectory = (fs, config) => {
const fetchRemoteComparisonImages = async config => {
if (config.remote) {
await deleteRemote('generatedDiffs', config);
return Promise.all(
config.scenarios.map(scenario =>
scenario.viewports.map(viewport => {
const promises = [];
const fetchRemotePromise = fetchRemote(
config,
'baseline',
`${scenario.label}-${viewport.label}.png`
);
promises.push(fetchRemotePromise);
return Promise.all(promises);
})
)

const promises = [];

config.scenarios.map(scenario =>
scenario.viewports.map(viewport => {
const fetchRemotePromise = fetchRemote(
config,
'baseline',
`${scenario.label}-${viewport.label}.png`
);
promises.push(fetchRemotePromise);
})
);

return Promise.all(promises);
}
};

Expand Down

0 comments on commit a189c27

Please sign in to comment.