Skip to content

Commit

Permalink
fix: ensure payload includes up-to-date _img (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jun 2, 2021
1 parent e71311f commit 03ea6fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/runtime/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export function createImage (globalOptions: CreateImageOptions, nuxtContext: any
if (ssrContext) {
const ssrState = ssrContext.nuxt || {}
const staticImages = ssrState._img = ssrState._img || {}
const ssrData = ssrState.data?.[0]
if (ssrData) {
ssrData._img = staticImages
}
const mapToStatic: MapToStatic = ssrContext.image?.mapToStatic
if (typeof mapToStatic === 'function') {
const mappedURL = mapToStatic(image)
Expand Down

0 comments on commit 03ea6fe

Please sign in to comment.