Merge pull request #1007 from afermon/main

fix: App is stuck when capturing all webviews on macOS
This commit is contained in:
Manoj Vivek 2023-07-07 10:29:30 +05:30 committed by GitHub
commit 8be1af0713
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,7 +38,7 @@ const captureImage = async (
const bgColor = window.getComputedStyle(document.body).backgroundColor;
if (bgColor === 'rgba(0, 0, 0, 0)') {
document.body.style.backgroundColor = 'white';
}
}
window.isExecuted = true;
`);
}
@ -58,8 +58,9 @@ const quickScreenshot = async (
if (image === undefined) {
return { done: false };
}
const fileName = name.replaceAll('/', '-').replaceAll(':', '-');
const dir = path.join(homedir(), `Desktop/Responsively-Screenshots`);
const filePath = path.join(dir, `/${name}-${Date.now()}.jpeg`);
const filePath = path.join(dir, `/${fileName}-${Date.now()}.jpeg`);
await ensureDir(dir);
await writeFile(filePath, image.toJPEG(100));
setTimeout(() => shell.showItemInFolder(filePath), 100);