mirror of
https://github.com/responsively-org/responsively-app
synced 2024-11-10 06:44:13 +00:00
Merge pull request #1007 from afermon/main
fix: App is stuck when capturing all webviews on macOS
This commit is contained in:
commit
8be1af0713
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue