Skip to content

Commit

Permalink
Update pdp.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fnhipster committed Nov 27, 2024
1 parent ddb8336 commit 118fd18
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/initializers/pdp.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,21 @@ await initializeDropin(async () => {
});
})();

function preloadImageMiddleware(data) {
async function preloadImageMiddleware(data) {
const image = data?.images?.[0]?.url;

if (image) {
UI.render(Image, {
const $wrapper = document.createElement('div');
await UI.render(Image, {
src: image,
...IMAGES_SIZES.mobile,
params: {
...IMAGES_SIZES,
},
loading: 'eager',
})(document.createElement('div'));
})($wrapper);

console.log($wrapper);

Check failure on line 77 in scripts/initializers/pdp.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
}
return data;
}
}

0 comments on commit 118fd18

Please sign in to comment.