Skip to content

Commit

Permalink
Fix: AI - Screenshots are not being generated properly
Browse files Browse the repository at this point in the history
  • Loading branch information
matipojo committed Nov 14, 2023
1 parent 5bd0275 commit 3bc2f1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/ai/assets/js/editor/utils/screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export const takeScreenshot = async ( template ) => {
// Wait for the container to render.
await waitForContainer( container.id );

if ( template.elements.length ) {
await Promise.all( template.elements.map( ( child ) => waitForContainer( child.id ) ) );
}

let screenshot;

try {
Expand Down

0 comments on commit 3bc2f1a

Please sign in to comment.