Skip to content

Commit

Permalink
fix: Fixing async await syntax for arrayBuffer
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Jul 31, 2022
1 parent 51ca568 commit a404672
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/fibr/templates/story.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,10 @@

const lazyImage = entry.target;
if (window.webpHero) {
const content = await fetch(lazyImage.dataset.src, {
const response = await fetch(lazyImage.dataset.src, {
credentials: 'same-origin',
}).arrayBuffer();
})
const content = await response.arrayBuffer();

const webpMachine = new webpHero.WebpMachine();
lazyImage.src = await webpMachine.decode(new Uint8Array(content));
Expand Down

0 comments on commit a404672

Please sign in to comment.