Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 );
} );
}
} );
}