Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then( () => {
if ( formTheme === 'grid' || ( !formTheme && printHelper.isGrid() ) ) {
const paper = { format: settings.format, landscape: settings.landscape, scale: settings.scale, margin: settings.margin };
return printHelper.fixGrid( paper );
}
} )
.then( () => // allow some time for repainting
function printGrid( format ) {
const swapped = printHelper.styleToAll();
return printHelper.fixGrid( format )
.then( window.print )
.catch( console.error )
.then( () => {
if ( swapped ) {
return new Promise( resolve => {
setTimeout( () => {
printHelper.styleReset();
resolve();
}, 500 );
} );
}
} );
}